Commit fe2d0429 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix an assert when trying to export a PNG image sequence

BUG:398608
parent 5a6aa506
......@@ -393,10 +393,8 @@ KisImportExportManager::ConversionResult KisImportExportManager::convert(KisImpo
return result;
}
void KisImportExportManager::fillStaticExportConfigurationProperties(KisPropertiesConfigurationSP exportConfiguration)
void KisImportExportManager::fillStaticExportConfigurationProperties(KisPropertiesConfigurationSP exportConfiguration, KisImageSP image)
{
// Fill with some meta information about the image
KisImageSP image = m_document->image();
KisPaintDeviceSP dev = image->projection();
const KoColorSpace* cs = dev->colorSpace();
const bool isThereAlpha =
......@@ -412,6 +410,12 @@ void KisImportExportManager::fillStaticExportConfigurationProperties(KisProperti
exportConfiguration->setProperty(KisImportExportFilter::sRGBTag, sRGB);
}
void KisImportExportManager::fillStaticExportConfigurationProperties(KisPropertiesConfigurationSP exportConfiguration)
{
return fillStaticExportConfigurationProperties(exportConfiguration, m_document->image());
}
bool KisImportExportManager::askUserAboutExportConfiguration(
QSharedPointer<KisImportExportFilter> filter,
KisPropertiesConfigurationSP exportConfiguration,
......
......@@ -110,6 +110,12 @@ public:
*/
static KisImportExportFilter *filterForMimeType(const QString &mimetype, Direction direction);
/**
* Fill necessary information for the export filter into the properties, e.g. if the image has
* transparency or has sRGB profile.
*/
static void fillStaticExportConfigurationProperties(KisPropertiesConfigurationSP exportConfiguration, KisImageSP image);
/**
* Get if the filter manager is batch mode (true)
* or in interactive mode (true)
......
......@@ -424,11 +424,21 @@ void DlgAnimationRenderer::sequenceMimeTypeSelected()
if (filter) {
m_frameExportConfigWidget = filter->createConfigurationWidget(0, KisDocument::nativeFormatMimeType(), mimetype.toLatin1());
if (m_frameExportConfigWidget) {
m_frameExportConfigWidget->setConfiguration(filter->lastSavedConfiguration("", mimetype.toLatin1()));
KisPropertiesConfigurationSP config = filter->lastSavedConfiguration("", mimetype.toLatin1());
if (config) {
KisImportExportManager::fillStaticExportConfigurationProperties(config, m_image);
}
m_frameExportConfigWidget->setConfiguration(config);
KoDialog dlg(this);
dlg.setMainWidget(m_frameExportConfigWidget);
dlg.setButtons(KoDialog::Ok | KoDialog::Cancel);
if (!dlg.exec()) {
config = filter->lastSavedConfiguration();
if (config) {
KisImportExportManager::fillStaticExportConfigurationProperties(config, m_image);
}
m_frameExportConfigWidget->setConfiguration(filter->lastSavedConfiguration());
}
m_frameExportConfigWidget->hide();
......
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