r21891 by jghali - avoid tagging image with ICC profile when exporting PDF/X-4 and profile is the same as PDF/X output intent

scribus-commit scribus-commit at lists.scribus.net
Fri Apr 14 10:29:32 UTC 2017


Author: jghali
Date: Fri Apr 14 10:29:32 2017
New Revision: 21891

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21891
Log:
avoid tagging image with ICC profile when exporting PDF/X-4 and profile is the same as PDF/X output intent

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21891&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Fri Apr 14 10:29:32 2017
@@ -10119,6 +10119,7 @@
 	bool   bitmapFromGS = false;
 	bool   isEmbeddedPDF = false;
 	bool   hasGrayProfile = false;
+	bool   avoidPDFXOutputIntentProf = false;
 	QString profInUse = Profil;
 	int    afl = Options.Resolution;
 	double ax, ay, a2, a1;
@@ -10395,7 +10396,12 @@
 							components = 3;
 						}
 					}
-					if (!ICCProfiles.contains(profInUse))
+					// PDF-X/4 requires that CMYK images using the same profile as PDF/X output intent
+					// do not be tagged with an ICC profile so they can go through color conversion
+					// pipeline without alteration
+					if (Options.Version == PDFOptions::PDFVersion_X4)
+						avoidPDFXOutputIntentProf = (profInUse == Options.PrintProf);
+					if (!ICCProfiles.contains(profInUse) && !avoidPDFXOutputIntentProf)
 					{
 						PdfICCD dataD;
 						PdfId embeddedProfile = writer.newObject();
@@ -10654,7 +10660,7 @@
 				outType = ColorSpaceMonochrome;
 			else
 				outType = getOutputType(exportToGrayscale, exportToCMYK);
-			if ((outType != ColorSpaceMonochrome) && (doc.HasCMS) && (Options.UseProfiles2))
+			if ((outType != ColorSpaceMonochrome) && (doc.HasCMS) && (Options.UseProfiles2) && (!avoidPDFXOutputIntentProf))
 			{
 				PutDoc("/ColorSpace "+ICCProfiles[profInUse].ICCArray+"\n");
 				PutDoc("/Intent /");




More information about the scribus-commit mailing list