diff --git a/src/ExportManager.cpp b/src/ExportManager.cpp --- a/src/ExportManager.cpp +++ b/src/ExportManager.cpp @@ -286,6 +286,15 @@ { QImageWriter imageWriter(device, format); imageWriter.setQuality(SpectacleConfig::instance()->compressionQuality()); + /** Set compression 50 if the format is png. Otherwise if no compression value is specified + * it will fallback to using quality (QTBUG-43618) and produce huge files. + * See also qpnghandler.cpp#n1075. The other formats that do compression seem to have it + * enabled by default and only disabled if compression is set to 0, also any value except 0 + * has the same effect for them. + */ + if (format == "png") { + imageWriter.setCompression(50); + } if (!(imageWriter.canWrite())) { emit errorMessage(i18n("QImageWriter cannot write image: %1", imageWriter.errorString())); return false; diff --git a/src/SpectacleConfig.cpp b/src/SpectacleConfig.cpp --- a/src/SpectacleConfig.cpp +++ b/src/SpectacleConfig.cpp @@ -260,7 +260,7 @@ int SpectacleConfig::compressionQuality() const { - return mGuiConfig.readEntry(QStringLiteral("compressionQuality"), 89); + return mGuiConfig.readEntry(QStringLiteral("compressionQuality"), 90); } void SpectacleConfig::setCompressionQuality(int value)