diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-08-02 15:50:20 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-08-02 15:50:20 +0000 |
commit | 99901f942d249cda9c88d2ef317c8143ac1770e8 (patch) | |
tree | 55cbfe6f29142b0dcd2166f9565093f60f9bc996 /src/java-1.4/org | |
parent | f11d6d86d02cf0f984c6270cd4d5a78cbbd4e43e (diff) | |
download | xmlgraphics-fop-99901f942d249cda9c88d2ef317c8143ac1770e8.tar.gz xmlgraphics-fop-99901f942d249cda9c88d2ef317c8143ac1770e8.zip |
By using the getRGB() method we convert all PNG images to sRGB regardless of their original color spaces. So we should also always return the sRGB color space. Otherwise, grayscale PNGs, for example, will not be displayed correctly.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@428037 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java-1.4/org')
-rw-r--r-- | src/java-1.4/org/apache/fop/image/ImageIOImage.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/java-1.4/org/apache/fop/image/ImageIOImage.java b/src/java-1.4/org/apache/fop/image/ImageIOImage.java index db9262adc..463331530 100644 --- a/src/java-1.4/org/apache/fop/image/ImageIOImage.java +++ b/src/java-1.4/org/apache/fop/image/ImageIOImage.java @@ -21,6 +21,7 @@ package org.apache.fop.image; // AWT import java.awt.Color; +import java.awt.color.ColorSpace; import java.awt.image.ColorModel; import java.awt.image.IndexColorModel; import java.awt.image.BufferedImage; @@ -121,7 +122,9 @@ public class ImageIOImage extends AbstractFopImage { ColorModel cm = imageData.getColorModel(); this.bitsPerPixel = cm.getComponentSize(0); //only use first, we assume all are equal - this.colorSpace = cm.getColorSpace(); + //this.colorSpace = cm.getColorSpace(); + //We currently force the image to sRGB + this.colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB); int[] tmpMap = imageData.getRGB(0, 0, this.width, this.height, null, 0, this.width); |