]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla#48696 version 4: Bugfix for color model in IOCA IDE structure parameter...
authorPeter Hancock <phancock@apache.org>
Mon, 26 Sep 2011 11:43:38 +0000 (11:43 +0000)
committerPeter Hancock <phancock@apache.org>
Mon, 26 Sep 2011 11:43:38 +0000 (11:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1175808 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/afp/AFPDataObjectFactory.java
src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java
status.xml

index d7e8ea5f99ff674f0018c6eaad67b7d8055b8bac..615c22b17a486304e85b68b77a1db422162c8381 100644 (file)
@@ -124,8 +124,10 @@ public class AFPDataObjectFactory {
             break;
         case 4:
         case 8:
+            //A grayscale image
             ideStruct = content.needIDEStructureParameter();
             ideStruct.setBitsPerComponent(new int[] {bitsPerPixel});
+            ideStruct.setColorModel(IDEStructureParameter.COLOR_MODEL_YCBCR);
             break;
         case 24:
             ideStruct = content.needIDEStructureParameter();
@@ -139,7 +141,7 @@ public class AFPDataObjectFactory {
             throw new IllegalArgumentException("Unsupported number of bits per pixel: "
                     + bitsPerPixel);
         }
-        if (imageObjectInfo.isSubtractive()) {
+        if (bitsPerPixel > 1 && imageObjectInfo.isSubtractive()) {
             ideStruct = content.needIDEStructureParameter();
             ideStruct.setSubtractive(imageObjectInfo.isSubtractive());
         }
index b0cce02e113afaddf30ace5e4e8596aa00db248d..9bcdeda88675310e3e4aa5a49d0b7b48107ccd28 100644 (file)
@@ -46,7 +46,7 @@ public class IDEStructureParameter implements Streamable {
     private boolean grayCoding = false;
 
     /** the image color model */
-    private byte colorModel = COLOR_MODEL_YCRCB;
+    private byte colorModel = COLOR_MODEL_RGB;
 
     /** the array with the number of bits/IDE for each component */
     private byte[] bitsPerIDE = new byte[] {(byte)1}; //1-bit by default
index 4ee7029e047114268faff4f4e9291e810ab7aaed..24a7d3fce3a2407e26e0dbbeaf99826636a41750 100644 (file)
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Fonts" dev="PH" type="fix" fixes-bug="48696">
+        Bugfix for color model in IOCA IDE structure parameter for 4- and 8-bit grayscale images.
+        Revision 4.
+      </action>
       <action context="Fonts" dev="PH" type="fix" fixes-bug="51760" due-to="Mehdi Houshmand">
         Changes the way PostScript handles Graphics2D images such that if the language is set to
         level 3, the image is stored as an embedded file which has no length limit.  Previously it