]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2818: fix color spaces getting lost of pdf images
authorMatthias Reischenbacher <matthias@apache.org>
Tue, 9 Oct 2018 15:53:33 +0000 (15:53 +0000)
committerMatthias Reischenbacher <matthias@apache.org>
Tue, 9 Oct 2018 15:53:33 +0000 (15:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1843302 13f79535-47bb-0310-9956-ffa450edef68

fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java

index e269ad3617d0c68ccbcbb441864280a8d1ecc0dc..af2c27d9fd86a0f51e2eac1aa11d580d4d829715 100644 (file)
@@ -299,7 +299,10 @@ public class PDFResources extends PDFDictionary {
         }
 
         if (!this.colorSpaces.isEmpty() || (parent != null && !parent.colorSpaces.isEmpty())) {
-            PDFDictionary dict = new PDFDictionary(this);
+            PDFDictionary dict = (PDFDictionary)this.get("ColorSpace");
+            if (dict == null) {
+                dict = new PDFDictionary(this);
+            }
             if (parent != null) {
                 for (PDFColorSpace colorSpace : parent.colorSpaces.values()) {
                     dict.put(colorSpace.getName(), colorSpace);