Commit 2f8de900 authored by Halla Rempt's avatar Halla Rempt
Browse files

Fix exporting images on the command line

parent f89d7e20
......@@ -433,16 +433,11 @@ bool KisApplication::start(const KisApplicationArguments &args)
doc->openUrl(QUrl::fromLocalFile(fileName));
qApp->processEvents(); // For vector layers to be updated
KisImageBarrierLocker locker(doc->image());
KisImportExportFilter::ConversionStatus status = KisImportExportFilter::OK;
KisImportExportManager manager(doc);
manager.setBatchMode(true);
QByteArray mime(outputMimetype.toLatin1());
status = manager.exportDocument(exportFileName, mime);
if (status != KisImportExportFilter::OK) {
dbgKrita << "Could not export " << fileName << "to" << exportFileName << ":" << (int)status;
doc->setFileBatchMode(true);
doc->setOutputMimeType(outputMimetype.toLatin1());
if (!doc->exportDocument(QUrl::fromLocalFile(exportFileName))) {
dbgKrita << "Could not export " << fileName << "to" << exportFileName << ":" << doc->errorMessage();
}
nPrinted++;
QTimer::singleShot(0, this, SLOT(quit()));
......
......@@ -226,9 +226,6 @@ KisImportExportFilter::ConversionStatus KisImportExportManager::convert(KisImpor
if (exportConfiguration) {
// Fill with some meta information about the image
KisImageWSP image = m_document->image();
// the image must be locked at the higher levels
KIS_SAFE_ASSERT_RECOVER_NOOP(image->locked());
KisPaintDeviceSP pd = image->projection();
bool isThereAlpha = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment