diff --git a/libs/libkis/InfoObject.h b/libs/libkis/InfoObject.h --- a/libs/libkis/InfoObject.h +++ b/libs/libkis/InfoObject.h @@ -72,6 +72,7 @@ friend class Filter; friend class Document; + friend class Node; /** * @brief configuration gives access to the internal configuration object. Must * be used used internally in libkis diff --git a/libs/libkis/Node.h b/libs/libkis/Node.h --- a/libs/libkis/Node.h +++ b/libs/libkis/Node.h @@ -475,9 +475,11 @@ * @param filename the filename including extension * @param xRes the horizontal resolution in pixels per pt (there are 72 pts in an inch) * @param yRes the horizontal resolution in pixels per pt (there are 72 pts in an inch) + * @param exportConfiguration a configuration object appropriate to the file format. + * See Document->exportImage for InfoObject details. * @return true if saving succeeded, false if it failed. */ - bool save(const QString &filename, double xRes, double yRes); + bool save(const QString &filename, double xRes, double yRes, const InfoObject &exportConfiguration); /** * @brief mergeDown merges the given node with the first visible node underneath this node in the layerstack. diff --git a/libs/libkis/Node.cpp b/libs/libkis/Node.cpp --- a/libs/libkis/Node.cpp +++ b/libs/libkis/Node.cpp @@ -52,6 +52,7 @@ #include #include "kis_selection.h" +#include "InfoObject.h" #include "Krita.h" #include "Node.h" #include "Channel.h" @@ -515,7 +516,7 @@ return new Node(d->image, d->node->clone()); } -bool Node::save(const QString &filename, double xRes, double yRes) +bool Node::save(const QString &filename, double xRes, double yRes, const InfoObject &exportConfiguration) { if (!d->node) return false; if (filename.isEmpty()) return false; @@ -540,7 +541,7 @@ dst->cropImage(bounds); dst->initialRefreshGraph(); - bool r = doc->exportDocumentSync(QUrl::fromLocalFile(filename), mimeType.toLatin1()); + bool r = doc->exportDocumentSync(QUrl::fromLocalFile(filename), mimeType.toLatin1(), exportConfiguration.configuration()); if (!r) { qWarning() << doc->errorMessage(); } diff --git a/plugins/extensions/pykrita/sip/krita/Node.sip b/plugins/extensions/pykrita/sip/krita/Node.sip --- a/plugins/extensions/pykrita/sip/krita/Node.sip +++ b/plugins/extensions/pykrita/sip/krita/Node.sip @@ -55,7 +55,7 @@ QPoint position() const; bool remove(); Node *duplicate() /Factory/; - void save(const QString &filename, double xRes, double yRes); + void save(const QString &filename, double xRes, double yRes, const InfoObject & exportConfiguration); Node *mergeDown() /Factory/; void scaleNode(QPointF origin, int width, int height, QString strategy); void rotateNode(double radians);