diff options
author | Peter Hancock <phancock@apache.org> | 2011-09-26 11:43:38 +0000 |
---|---|---|
committer | Peter Hancock <phancock@apache.org> | 2011-09-26 11:43:38 +0000 |
commit | eebad9b8a3ea400539a8408cbc6dcb2386c18379 (patch) | |
tree | d869fe12f7de58217f6cb81cfb8a94be4e156011 /src/java | |
parent | 677accf2e9967c5eeda0ab118f145cf142401c41 (diff) | |
download | xmlgraphics-fop-eebad9b8a3ea400539a8408cbc6dcb2386c18379.tar.gz xmlgraphics-fop-eebad9b8a3ea400539a8408cbc6dcb2386c18379.zip |
Bugzilla#48696 version 4: Bugfix for color model in IOCA IDE structure parameter for 4- and 8-bit grayscale images.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1175808 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/afp/AFPDataObjectFactory.java | 4 | ||||
-rw-r--r-- | src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/afp/AFPDataObjectFactory.java b/src/java/org/apache/fop/afp/AFPDataObjectFactory.java index d7e8ea5f9..615c22b17 100644 --- a/src/java/org/apache/fop/afp/AFPDataObjectFactory.java +++ b/src/java/org/apache/fop/afp/AFPDataObjectFactory.java @@ -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()); } diff --git a/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java b/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java index b0cce02e1..9bcdeda88 100644 --- a/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java +++ b/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java @@ -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 |