r22625 by jghali - Backport r22574: mitigate some print preview issues caused by some broken checks of sRGB profiles in recent libpng versions

scribus-commit scribus-commit at lists.scribus.net
Sun Aug 12 12:04:10 UTC 2018


Author: jghali
Date: Sun Aug 12 12:04:10 2018
New Revision: 22625

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22625
Log:
Backport r22574: mitigate some print preview issues caused by some broken checks of sRGB profiles in recent libpng versions

Modified:
    branches/Version14x/Scribus/scribus/preview.cpp

Modified: branches/Version14x/Scribus/scribus/preview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22625&path=/branches/Version14x/Scribus/scribus/preview.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/preview.cpp	(original)
+++ branches/Version14x/Scribus/scribus/preview.cpp	Sun Aug 12 12:04:10 2018
@@ -128,18 +128,18 @@
 	Layout2->setAlignment( Qt::AlignTop );
 	AntiAlias = new QCheckBox(devTitle);
 	AntiAlias->setText( tr("Enable &Antialiasing"));
-	AntiAlias->setChecked( postscriptPreview ? prefsManager->appPrefs.PrPr_AntiAliasing : false);
-	AntiAlias->setEnabled( postscriptPreview );
+	AntiAlias->setChecked(postscriptPreview ? prefsManager->appPrefs.PrPr_AntiAliasing : false);
+	AntiAlias->setEnabled(postscriptPreview);
 	Layout2->addWidget(AntiAlias);
 	AliasTr = new QCheckBox(devTitle);
 	AliasTr->setText( tr("Display Trans&parency"));
-	AliasTr->setChecked(prefsManager->appPrefs.PrPr_Transparency);
-	AliasTr->setEnabled( postscriptPreview );
+	AliasTr->setChecked(postscriptPreview ? prefsManager->appPrefs.PrPr_Transparency : false);
+	AliasTr->setEnabled(postscriptPreview);
 	Layout2->addWidget(AliasTr);
 	EnableCMYK = new QCheckBox(devTitle);
 	EnableCMYK->setText( tr("&Display CMYK"));
-	EnableCMYK->setChecked( postscriptPreview ? prefsManager->appPrefs.PrPr_Mode : false);
-	EnableCMYK->setEnabled( postscriptPreview );
+	EnableCMYK->setChecked(postscriptPreview ? prefsManager->appPrefs.PrPr_Mode : false);
+	EnableCMYK->setEnabled(postscriptPreview);
 	Layout2->addWidget(EnableCMYK);
 	if (HaveTiffSep)
 	{
@@ -617,10 +617,10 @@
 	}
 	else
 	{
-		if ((!AliasTr->isChecked()) || (!HavePngAlpha))
-			args.append( "-sDEVICE=png16m" );
+		if (AliasTr->isChecked() && HavePngAlpha)
+			args.append( "-sDEVICE=pngalpha" );
 		else
-			args.append( "-sDEVICE=pngalpha" );
+			args.append( "-sDEVICE=tiff24nc" );
 	}
 	if (AntiAlias->isChecked())
 	{
@@ -656,8 +656,10 @@
 	// then add any final args and call gs
 	if ((EnableCMYK->isChecked()) && HaveTiffSep)
 		args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.tif")) );
+	else if ((AliasTr->isChecked() && HavePngAlpha) || !postscriptPreview)
+		args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.png")) );
 	else
-		args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.png")) );
+		args.append( QString("-sOutputFile=%1").arg(QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/sc.tif")) );
 	args.append( QDir::toNativeSeparators(ScPaths::getTempFileDir()+"/tmp.ps") );
 	args.append( "-c" );
 	args.append( "showpage" );
@@ -1257,7 +1259,12 @@
 	}
 	else
 	{
-		if (!image.load(ScPaths::getTempFileDir()+"/sc.png"))
+		QString previewFile;
+		if ((AliasTr->isChecked() && HavePngAlpha) || !postscriptPreview)
+			previewFile = ScPaths::getTempFileDir() + "/sc.png";
+		else
+			previewFile = ScPaths::getTempFileDir() + "/sc.tif";
+		if (!image.load(previewFile))
 		{
 			imageLoadError(Bild, Seite);
 			return Bild;




More information about the scribus-commit mailing list