Commit 921d9f87 authored by Halla Rempt's avatar Halla Rempt

Show the filter settings dialog from one central place

Instead of having the same logic in every filter that has a
settings dialog.

Note: raw and pdf import still have a local dialog.
parent 3670f82b
......@@ -34,12 +34,14 @@
#include <ksqueezedtextlabel.h>
#include <kpluginfactory.h>
#include "KoProgressUpdater.h"
#include "KoJsonTrader.h"
#include <KoDialog.h>
#include <KoProgressUpdater.h>
#include <KoJsonTrader.h>
#include <KisMimeDatabase.h>
#include <kis_config_widget.h>
#include <kis_debug.h>
#include <KisMimeDatabase.h>
#include "kis_config.h"
#include "KisImportExportFilter.h"
#include "KisDocument.h"
......@@ -191,10 +193,41 @@ KisImportExportFilter::ConversionStatus KisImportExportManager::convert(KisImpor
filter->setFilename(location);
filter->setBatchMode(batchMode());
filter->setMimeType(typeName);
if (d->progressUpdater) {
filter->setUpdater(d->progressUpdater->startSubtask());
}
QByteArray from, to;
if (direction == Export) {
from = m_document->nativeFormatMimeType();
to = mimeType.toLatin1();
}
else {
from = mimeType.toLatin1();
to = m_document->nativeFormatMimeType();
}
if (!exportConfiguration) {
exportConfiguration = filter->lastSavedConfiguration(from, to);
}
if (!batchMode()) {
KoDialog dlg;
dlg.setButtons(KoDialog::Ok | KoDialog::Cancel);
dlg.setWindowTitle(KisMimeDatabase::descriptionForMimeType(mimeType));
KisConfigWidget *wdg = filter->createConfigurationWidget(&dlg, from, to);
if (wdg) {
wdg->setConfiguration(exportConfiguration);
dlg.setMainWidget(wdg);
if (!dlg.exec()) {
return KisImportExportFilter::UserCancelled;
}
exportConfiguration = wdg->configuration();
}
QApplication::setOverrideCursor(Qt::WaitCursor);
}
QFile io(location);
if (direction == Import) {
......@@ -218,6 +251,12 @@ KisImportExportFilter::ConversionStatus KisImportExportManager::convert(KisImpor
KisImportExportFilter::ConversionStatus status = filter->convert(m_document, &io, exportConfiguration);
io.close();
KisConfig().setExportConfiguration(typeName, exportConfiguration);
if (!batchMode()) {
QApplication::setOverrideCursor(Qt::WaitCursor);
}
return status;
}
......
......@@ -67,22 +67,22 @@ KisDlgStrokeSelection::KisDlgStrokeSelection(KisImageWSP image, KisViewManager *
resize(m_page->sizeHint());
QString filterConfig = KisConfig().exportConfiguration("StrokeSelection");
KisPropertiesConfiguration cfg;
cfg.fromXML(filterConfig);
KisPropertiesConfigurationSP cfg(new KisPropertiesConfiguration());
cfg->fromXML(filterConfig);
auto &m_options = m_page->m_options;
m_options.color = cfg.getColor("color");
m_options.lineColorSource = cfg.getInt("lineColorSource");
m_options.color = cfg->getColor("color");
m_options.lineColorSource = cfg->getInt("lineColorSource");
m_page->lineColorBox->setCurrentIndex(m_options.lineColorSource);
m_page->colorSelector->setColor(getSelectedColor().toQColor());
m_options.brushSelected = cfg.getBool("useBrush", 0);
m_options.brushSelected = cfg->getBool("useBrush", 0);
m_page->typeBox->setCurrentIndex(m_options.brushSelected? 0 : 1);
m_options._colorFillSource = cfg.getInt("colorFillSource", 0);
m_options._colorFillSource = cfg->getInt("colorFillSource", 0);
m_page->fillBox->setCurrentIndex(m_options._colorFillSource);
m_options.customColor = cfg.getColor("customColor");
m_options.customColor = cfg->getColor("customColor");
if (m_options._colorFillSource == static_cast<int>(colorFillSource::CustomColor)) {
m_page->colorFillSelector->setColor(m_options.customColor.toQColor());
}
......@@ -90,14 +90,14 @@ KisDlgStrokeSelection::KisDlgStrokeSelection(KisImageWSP image, KisViewManager *
m_page->colorFillSelector->setColor(getFillSelectedColor().toQColor());
}
m_options.fillColor = cfg.getColor("fillColor");
m_options.fillColor = cfg->getColor("fillColor");
if (m_options._colorFillSource == static_cast<int>(colorFillSource::None)) {
m_page->colorFillSelector->setDisabled(true);
}
else {
m_page->colorFillSelector->setDisabled(false); }
m_options.lineSize = cfg.getInt("lineSize", 1);
m_options.lineSize = cfg->getInt("lineSize", 1);
m_page->lineSize->setValue(m_options.lineSize);
if (m_options.brushSelected) {
m_page->lineSize->setDisabled(true);
......@@ -106,7 +106,7 @@ KisDlgStrokeSelection::KisDlgStrokeSelection(KisImageWSP image, KisViewManager *
m_page->sizeBox->setDisabled(true);
}
m_options.lineDimension = cfg.getInt("lineDimension", 0);
m_options.lineDimension = cfg->getInt("lineDimension", 0);
m_page->sizeBox->setCurrentIndex(m_options.lineDimension);
connect(m_page, SIGNAL(colorSelectorChanged()), SLOT(setColorButton()));
......@@ -127,24 +127,24 @@ KisDlgStrokeSelection::~KisDlgStrokeSelection()
m_options.lineDimension = m_page->sizeBox->currentIndex();
m_options.lineColorSource = m_page->lineColorBox->currentIndex();
KisPropertiesConfiguration cfg;
cfg.setProperty("lineSize", m_options.lineSize);
cfg.setProperty("colorFillSource", m_options._colorFillSource);
cfg.setProperty("useBrush", m_options.brushSelected);
cfg.setProperty("lineDimension", m_options.lineDimension);
cfg.setProperty("lineColorSource", m_options.lineColorSource);
KisPropertiesConfigurationSP cfg(new KisPropertiesConfiguration());
cfg->setProperty("lineSize", m_options.lineSize);
cfg->setProperty("colorFillSource", m_options._colorFillSource);
cfg->setProperty("useBrush", m_options.brushSelected);
cfg->setProperty("lineDimension", m_options.lineDimension);
cfg->setProperty("lineColorSource", m_options.lineColorSource);
QVariant colorVariant("KoColor");
colorVariant.setValue(m_options.customColor);
cfg.setProperty("customColor", colorVariant);
cfg->setProperty("customColor", colorVariant);
QVariant _colorVariant("KoColor");
_colorVariant.setValue(m_options.color);
cfg.setProperty("color", _colorVariant);
cfg->setProperty("color", _colorVariant);
QVariant _cVariant("KoColor");
_cVariant.setValue(m_options.fillColor);
cfg.setProperty("fillColor", _cVariant);
cfg->setProperty("fillColor", _cVariant);
KisConfig().setExportConfiguration("StrokeSelection", cfg);
......
......@@ -1170,9 +1170,9 @@ QString KisConfig::exportConfiguration(const QString &filterId, bool defaultValu
return (defaultValue ? QString() : m_cfg.readEntry("ExportConfiguration-" + filterId, QString()));
}
void KisConfig::setExportConfiguration(const QString &filterId, const KisPropertiesConfiguration &properties) const
void KisConfig::setExportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const
{
QString exportConfig = properties.toXML();
QString exportConfig = properties->toXML();
m_cfg.writeEntry("ExportConfiguration-" + filterId, exportConfig);
}
......
......@@ -310,7 +310,7 @@ public:
void setFavoriteCompositeOps(const QStringList& compositeOps) const;
QString exportConfiguration(const QString &filterId, bool defaultValue = false) const;
void setExportConfiguration(const QString &filterId, const KisPropertiesConfiguration &properties) const;
void setExportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const;
bool useOcio(bool defaultValue = false) const;
void setUseOcio(bool useOCIO) const;
......@@ -438,7 +438,7 @@ public:
bool useEraserBrushOpacity(bool defaultValue = false) const;
void setUseEraserBrushOpacity(bool value);
QColor getMDIBackgroundColor(bool defaultValue = false) const;
void setMDIBackgroundColor(const QColor & v) const;
......
......@@ -94,7 +94,7 @@ void AnimaterionRenderer::slotRenderAnimation()
if (dlgAnimationRenderer.exec() == QDialog::Accepted) {
KisPropertiesConfigurationSP sequenceConfig = dlgAnimationRenderer.getSequenceConfiguration();
kisConfig.setExportConfiguration("IMAGESEQUENCE", *sequenceConfig.data());
kisConfig.setExportConfiguration("IMAGESEQUENCE", sequenceConfig);
QString mimetype = sequenceConfig->getString("mimetype");
QString extension = KisMimeDatabase::suffixesForMimeType(mimetype).first();
QString baseFileName = QString("%1/%2.%3").arg(sequenceConfig->getString("directory"))
......@@ -108,11 +108,11 @@ void AnimaterionRenderer::slotRenderAnimation()
KisPropertiesConfigurationSP videoConfig = dlgAnimationRenderer.getVideoConfiguration();
if (videoConfig) {
kisConfig.setExportConfiguration("ANIMATION_RENDERER", *videoConfig.data());
kisConfig.setExportConfiguration("ANIMATION_RENDERER", videoConfig);
KisPropertiesConfigurationSP encoderConfig = dlgAnimationRenderer.getEncoderConfiguration();
if (encoderConfig) {
kisConfig.setExportConfiguration("FFMPEG_CONFIG", *encoderConfig.data());
kisConfig.setExportConfiguration("FFMPEG_CONFIG", encoderConfig);
encoderConfig->setProperty("savedFilesMask", savedFilesMask);
}
......
......@@ -23,7 +23,6 @@
#include <QSlider>
#include <QApplication>
#include <KoDialog.h>
#include <kpluginfactory.h>
#include <QFileInfo>
......@@ -77,37 +76,11 @@ KisImportExportFilter::ConversionStatus exrExport::convert(KisDocument *document
{
KisImageWSP image = document->image();
KoDialog kdb;
kdb.setWindowTitle(i18n("OpenEXR Export Options"));
kdb.setButtons(KoDialog::Ok | KoDialog::Cancel);
KisConfigWidget *wdg = createConfigurationWidget(&kdb, KisDocument::nativeFormatMimeType(), "image/x-exr");
kdb.setMainWidget(wdg);
kdb.resize(kdb.minimumSize());
// If a configuration object was passed to the convert method, we use that, otherwise we load from the settings
KisPropertiesConfigurationSP cfg(new KisPropertiesConfiguration());
if (configuration) {
cfg->fromXML(configuration->toXML());
}
else {
cfg = lastSavedConfiguration(KisDocument::nativeFormatMimeType(), "image/x-exr");
}
wdg->setConfiguration(cfg);
if (!batchMode() ) {
QApplication::restoreOverrideCursor();
if (kdb.exec() == QDialog::Rejected) {
return KisImportExportFilter::UserCancelled;
}
cfg = wdg->configuration();
KisConfig().setExportConfiguration("EXR", *cfg.data());
}
exrConverter kpc(document, !batchMode());
KisImageBuilder_Result res;
if (cfg->getBool("flatten")) {
if (configuration->getBool("flatten")) {
// the image must be locked at the higher levels
KIS_SAFE_ASSERT_RECOVER_NOOP(document->image()->locked());
......
......@@ -32,8 +32,6 @@
#include <KoColorSpaceRegistry.h>
#include <KoColorModelStandardIds.h>
#include <KoDialog.h>
#include <kis_debug.h>
#include <KisDocument.h>
#include <kis_image.h>
......@@ -88,34 +86,9 @@ KisImportExportFilter::ConversionStatus KisHeightMapExport::convert(KisDocument
return KisImportExportFilter::WrongFormat;
}
KoDialog kdb;
kdb.setWindowTitle(i18n("HeightMap Export Options"));
kdb.setButtons(KoDialog::Ok | KoDialog::Cancel);
KisConfigWidget *wdg = createConfigurationWidget(&kdb, KisDocument::nativeFormatMimeType(), mimeType());
kdb.setMainWidget(wdg);
QApplication::restoreOverrideCursor();
// If a configuration object was passed to the convert method, we use that, otherwise we load from the settings
KisPropertiesConfigurationSP cfg(new KisPropertiesConfiguration());
if (configuration) {
cfg->fromXML(configuration->toXML());
}
else {
cfg = lastSavedConfiguration(KisDocument::nativeFormatMimeType(), mimeType());
}
cfg->setProperty("width", image->width());
wdg->setConfiguration(cfg);
if (!batchMode()) {
if (kdb.exec() == QDialog::Rejected) {
return KisImportExportFilter::UserCancelled;
}
cfg = wdg->configuration();
KisConfig().setExportConfiguration("HeightMap", *cfg.data());
}
configuration->setProperty("width", image->width());
QDataStream::ByteOrder bo = cfg->getInt("endianness", 0) ? QDataStream::BigEndian : QDataStream::LittleEndian;
QDataStream::ByteOrder bo = configuration->getInt("endianness", 0) ? QDataStream::BigEndian : QDataStream::LittleEndian;
bool downscale = false;
if (mimeType() == "image/x-r8" && image->colorSpace()->colorDepthId() == Integer16BitsColorDepthID) {
......
......@@ -87,14 +87,14 @@ KisImportExportFilter::ConversionStatus KisHeightMapImport::convert(KisDocument
kdb->setMainWidget(wdg);
QString filterConfig = KisConfig().exportConfiguration("HeightMap");
KisPropertiesConfiguration cfg;
cfg.fromXML(filterConfig);
KisPropertiesConfigurationSP cfg(new KisPropertiesConfiguration);
cfg->fromXML(filterConfig);
int w = 0;
int h = 0;
optionsHeightMap.intSize->setValue(0);
int endianness = cfg.getInt("endianness", 0);
int endianness = cfg->getInt("endianness", 0);
if (endianness == 0) {
optionsHeightMap.radioMac->setChecked(true);
}
......@@ -116,12 +116,12 @@ KisImportExportFilter::ConversionStatus KisHeightMapImport::convert(KisDocument
// }
QDataStream::ByteOrder bo = QDataStream::LittleEndian;
cfg.setProperty("endianness", 1);
cfg->setProperty("endianness", 1);
if (optionsHeightMap.radioMac->isChecked()) {
bo = QDataStream::BigEndian;
cfg.setProperty("endianness", 0);
cfg->setProperty("endianness", 0);
}
KisConfig().setExportConfiguration("HeightMap", cfg);
KisConfig().setExportConfiguration(mimeType(), cfg);
QDataStream s(io);
s.setByteOrder(bo);
......
......@@ -25,17 +25,16 @@
#include <QString>
#include <QStringList>
#include <QApplication>
#include <QFileInfo>
#include <KoDialog.h>
#include <kpluginfactory.h>
#include <QFileInfo>
#include <KoColorSpace.h>
#include <KoColorProfile.h>
#include <KisImportExportManager.h>
#include <KoColorSpaceConstants.h>
#include <KoColorSpaceRegistry.h>
#include <KisImportExportManager.h>
#include <kis_slider_spin_box.h>
#include <KisDocument.h>
#include <kis_image.h>
......@@ -48,9 +47,9 @@
#include <metadata/kis_meta_data_filter_registry_model.h>
#include <metadata/kis_exif_info_visitor.h>
#include <generator/kis_generator_layer.h>
#include "kis_jpeg_converter.h"
#include <KisImportExportManager.h>
#include "kis_jpeg_converter.h"
class KisExternalLayer;
......@@ -69,56 +68,26 @@ KisImportExportFilter::ConversionStatus KisJPEGExport::convert(KisDocument *docu
KisImageWSP image = document->image();
Q_CHECK_PTR(image);
KoDialog kdb;
kdb.setWindowTitle(i18n("JPEG Export Options"));
kdb.setButtons(KoDialog::Ok | KoDialog::Cancel);
KisConfigWidget *wdg = createConfigurationWidget(&kdb, KisDocument::nativeFormatMimeType(), "image/jpeg");
kdb.setMainWidget(wdg);
kdb.resize(kdb.minimumSize());
// If a configuration object was passed to the convert method, we use that, otherwise we load from the settings
KisPropertiesConfigurationSP cfg(new KisPropertiesConfiguration());
if (configuration) {
cfg->fromXML(configuration->toXML());
}
else {
cfg = lastSavedConfiguration(KisDocument::nativeFormatMimeType(), "image/jpeg");
}
// An extra option to pass to the config widget to set the state correctly, this isn't saved
const KoColorSpace* cs = image->projection()->colorSpace();
bool sRGB = cs->profile()->name().contains(QLatin1String("srgb"), Qt::CaseInsensitive);
cfg->setProperty("is_sRGB", sRGB);
wdg->setConfiguration(cfg);
QApplication::restoreOverrideCursor();
if (!batchMode()) {
if (kdb.exec() == QDialog::Rejected) {
return KisImportExportFilter::UserCancelled;
}
cfg = wdg->configuration();
KisConfig().setExportConfiguration("JPEG", *cfg.data());
}
configuration->setProperty("is_sRGB", sRGB);
KisJPEGOptions options;
options.progressive = cfg->getBool("progressive", false);
options.quality = cfg->getInt("quality", 80);
options.forceSRGB = cfg->getBool("forceSRGB", false);
options.saveProfile = cfg->getBool("saveProfile", true);
options.optimize = cfg->getBool("optimize", true);
options.smooth = cfg->getInt("smoothing", 0);
options.baseLineJPEG = cfg->getBool("baseline", true);
options.subsampling = cfg->getInt("subsampling", 0);
options.exif = cfg->getBool("exif", true);
options.iptc = cfg->getBool("iptc", true);
options.xmp = cfg->getBool("xmp", true);
options.transparencyFillColor = cfg->getColor("transparencyFillcolor").toQColor();
options.progressive = configuration->getBool("progressive", false);
options.quality = configuration->getInt("quality", 80);
options.forceSRGB = configuration->getBool("forceSRGB", false);
options.saveProfile = configuration->getBool("saveProfile", true);
options.optimize = configuration->getBool("optimize", true);
options.smooth = configuration->getInt("smoothing", 0);
options.baseLineJPEG = configuration->getBool("baseline", true);
options.subsampling = configuration->getInt("subsampling", 0);
options.exif = configuration->getBool("exif", true);
options.iptc = configuration->getBool("iptc", true);
options.xmp = configuration->getBool("xmp", true);
options.transparencyFillColor = configuration->getColor("transparencyFillcolor").toQColor();
KisMetaData::FilterRegistryModel m;
m.setEnabledFilters(cfg->getString("filters").split(","));
m.setEnabledFilters(configuration->getString("filters").split(","));
options.filters = m.enabledFilters();
// the image must be locked at the higher levels
......@@ -130,7 +99,7 @@ KisImportExportFilter::ConversionStatus KisJPEGExport::convert(KisDocument *docu
vKisAnnotationSP_it beginIt = image->beginAnnotations();
vKisAnnotationSP_it endIt = image->endAnnotations();
KisImageBuilder_Result res;
KisExifInfoVisitor eIV;
eIV.visit(image->rootLayer().data());
......@@ -142,8 +111,10 @@ KisImportExportFilter::ConversionStatus KisJPEGExport::convert(KisDocument *docu
KisMetaData::Store* copy = new KisMetaData::Store(*eI);
eI = copy;
}
if ((res = kpc.buildFile(io, l, beginIt, endIt, options, eI)) == KisImageBuilder_RESULT_OK) {
dbgFile << "success !";
KisImageBuilder_Result res = kpc.buildFile(io, l, beginIt, endIt, options, eI);
if (res == KisImageBuilder_RESULT_OK) {
delete eI;
return KisImportExportFilter::OK;
}
......@@ -175,7 +146,7 @@ KisPropertiesConfigurationSP KisJPEGExport::defaultConfiguration(const QByteArra
KisPropertiesConfigurationSP KisJPEGExport::lastSavedConfiguration(const QByteArray &from, const QByteArray &to) const
{
KisPropertiesConfigurationSP cfg = defaultConfiguration(from, to);
QString filterConfig = KisConfig().exportConfiguration("JPEG");
QString filterConfig = KisConfig().exportConfiguration(to);
cfg->fromXML(filterConfig, false);
return cfg;
}
......
......@@ -23,7 +23,6 @@
#include <QSlider>
#include <QApplication>
#include <KoDialog.h>
#include <kpluginfactory.h>
#include <QMessageBox>
......@@ -79,7 +78,6 @@ KisImportExportFilter::ConversionStatus KisPNGExport::convert(KisDocument *docum
pd = new KisPaintDevice(*image->projection());
KisPaintLayerSP l = new KisPaintLayer(image, "projection", OPACITY_OPAQUE_U8, pd);
if (!KisPNGConverter::isColorSpaceSupported(pd->colorSpace())) {
if (!batchMode()) {
QMessageBox::critical(0, i18nc("@title:window", "Krita PNG Export"), i18n("You can only save grayscale and RGB images to PNG. Convert your image before exporting to PNG."));
......@@ -87,85 +85,54 @@ KisImportExportFilter::ConversionStatus KisPNGExport::convert(KisDocument *docum
return KisImportExportFilter::UsageError;
}
bool isThereAlpha = false;
KisSequentialConstIterator it(l->paintDevice(), image->bounds());
const KoColorSpace* cs = l->paintDevice()->colorSpace();
KisPNGOptions options;
bool isThereAlpha = false;
KisPropertiesConfigurationSP cfg = defaultConfiguration();
do {
if (cs->opacityU8(it.oldRawData()) != OPACITY_OPAQUE_U8) {
isThereAlpha = true;
break;
}
} while (it.nextPixel());
configuration->setProperty("isThereAlpha", isThereAlpha);
configuration->setProperty("ColorModelID", cs->colorModelId().id());
bool sRGB = (cs->profile()->name().contains(QLatin1String("srgb"), Qt::CaseInsensitive) && !cs->profile()->name().contains(QLatin1String("g10")));
configuration->setProperty("sRGB", sRGB);
if (!qApp->applicationName().toLower().contains("test")) {
KoDialog kdb;
kdb.setCaption(i18n("PNG Export Options"));
kdb.setButtons(KoDialog::Ok | KoDialog::Cancel);
KisConfigWidget *wdg = createConfigurationWidget(&kdb, KisDocument::nativeFormatMimeType(), "image/png");
kdb.setMainWidget(wdg);
// If a configuration object was passed to the convert method, we use that, otherwise we load from the settings
if (configuration) {
cfg->fromXML(configuration->toXML());
}
else {
cfg = lastSavedConfiguration(KisDocument::nativeFormatMimeType(), "image/png");
}
cfg->setProperty("ColorModelID", cs->colorModelId().id());
bool sRGB = (cs->profile()->name().contains(QLatin1String("srgb"), Qt::CaseInsensitive)
&& !cs->profile()->name().contains(QLatin1String("g10")));
cfg->setProperty("sRGB", sRGB);
cfg->setProperty("isThereAlpha", isThereAlpha);
wdg->setConfiguration(cfg);
QApplication::restoreOverrideCursor();
if (hasVisibleWidgets()) {
if (!batchMode()) {
if (kdb.exec() == QDialog::Rejected) {
return KisImportExportFilter::UserCancelled;
}
cfg = wdg->configuration();
KisConfig().setExportConfiguration("PNG", *cfg.data());
}
}
}
KisPNGOptions options;
options.alpha = cfg->getBool("alpha", true);
options.interlace = cfg->getBool("interlaced", false);
options.compression = cfg->getInt("compression", 0);
options.tryToSaveAsIndexed = cfg->getBool("indexed", false);
options.transparencyFillColor = cfg->getColor("transparencyFillColor").toQColor();
options.saveSRGBProfile = cfg->getBool("saveSRGBProfile", false);
options.forceSRGB = cfg->getBool("forceSRGB", true);
options.alpha = configuration->getBool("alpha", true);
options.interlace = configuration->getBool("interlaced", false);
options.compression = configuration->getInt("compression", 0);
options.tryToSaveAsIndexed = configuration->getBool("indexed", false);
options.transparencyFillColor = configuration->getColor("transparencyFillColor").toQColor();
options.saveSRGBProfile = configuration->getBool("saveSRGBProfile", false);
options.forceSRGB = configuration->getBool("forceSRGB", true);
vKisAnnotationSP_it beginIt = image->beginAnnotations();
vKisAnnotationSP_it endIt = image->endAnnotations();
KisImageBuilder_Result res;
KisExifInfoVisitor eIV;
eIV.visit(image->rootLayer().data());
KisMetaData::Store* eI = 0;
if (eIV.countPaintLayer() == 1)
KisMetaData::Store *eI = 0;
if (eIV.countPaintLayer() == 1) {
eI = eIV.exifInfo();
}
if (eI) {
KisMetaData::Store* copy = new KisMetaData::Store(*eI);
eI = copy;
}
KisPNGConverter pngConverter(document);
if ((res = pngConverter.buildFile(io, image->bounds(), image->xRes(), image->yRes(), l->paintDevice(), beginIt, endIt, options, eI)) == KisImageBuilder_RESULT_OK) {
dbgFile << "success !";
KisImageBuilder_Result res = pngConverter.buildFile(io, image->bounds(), image->xRes(), image->yRes(), l->paintDevice(), beginIt, endIt