pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1863751 - /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
Date Thu, 25 Jul 2019 16:54:43 GMT
Author: tilman
Date: Thu Jul 25 16:54:43 2019
New Revision: 1863751

URL: http://svn.apache.org/viewvc?rev=1863751&view=rev
Log:
PDFBOX-4607: set correct /Alternate colorspace for images with gray colorspace, by Emmeran
Seehuber

Modified:
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java?rev=1863751&r1=1863750&r2=1863751&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
(original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
Thu Jul 25 16:54:43 2019
@@ -562,8 +562,10 @@ public final class LosslessFactory
 
             ColorSpace srcCspace = image.getColorModel().getColorSpace();
             int srcCspaceType = srcCspace.getType();
-			PDColorSpace pdColorSpace = srcCspaceType != ColorSpace.TYPE_CMYK
-                                        ? PDDeviceRGB.INSTANCE : PDDeviceCMYK.INSTANCE;
+            PDColorSpace pdColorSpace = srcCspaceType == ColorSpace.TYPE_CMYK
+                    ? PDDeviceCMYK.INSTANCE
+                    : (srcCspaceType == ColorSpace.TYPE_GRAY
+                            ? PDDeviceGray.INSTANCE : PDDeviceRGB.INSTANCE);
 
             // Encode the image profile if the image has one
             if (srcCspace instanceof ICC_ColorSpace)



Mime
View raw message