Commit 28f04a75 authored by Halla Rempt's avatar Halla Rempt
Browse files

BUG:348099 Better error message in PNG export

parent ade8e492
......@@ -102,14 +102,10 @@ KisImportExportFilter::ConversionStatus KisPNGExport::convert(const QByteArray&
KisPaintLayerSP l = new KisPaintLayer(image, "projection", OPACITY_OPAQUE_U8, pd);
image->unlock();
QStringList supportedColorModelIds;
supportedColorModelIds << RGBAColorModelID.id() << GrayAColorModelID.id() << GrayColorModelID.id();
QStringList supportedColorDepthIds;
supportedColorDepthIds << Integer8BitsColorDepthID.id() << Integer16BitsColorDepthID.id();
if (!supportedColorModelIds.contains(pd->colorSpace()->colorModelId().id()) ||
!supportedColorDepthIds.contains(pd->colorSpace()->colorDepthId().id())) {
if (!KisPNGConverter::isColorSpaceSupported(pd->colorSpace())) {
if (!m_chain->manager()->getBatchMode()) {
QMessageBox::critical(0, i18nc("@title:window", "Krita PNG Export"), i18n("Cannot export images in this colorspace or channel depth to PNG"));
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."));
}
return KisImportExportFilter::UsageError;
}
......
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