xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luis Bernardo <lmpmberna...@gmail.com>
Subject Re: AFP images
Date Thu, 13 Jun 2013 23:31:12 GMT

A follow-up...

I have been investigating the JPEG with CMYK issue and I found a 
solution. I have not looked at the other issues yet.

First, I don't think I provided the best link to the issue but it is 
"known fact" that the Sun ImageIO JPEG reader does not handle JPEG with 
CMYK. Now, in a famous bug that apparently is not available anymore 
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903) there was a 
comment that explained how to convert the CMYK color space to RGB if 
(and this is important) a CMYK ICC profile is provided. This workaround 
is implemented in xmlgraphics (in ImageLoaderImageIO).

Your provided sample_cmyk.jpg file does not include an embedded ICC 
profile. That is why the colors in the resulting AFP are completely off. 
If I embed a CMYK ICC profile then I do get the colors converted to RGB.

I also found a ImageIO library that can read JPEG with CMYK: 
https://java.net/projects/twelvemonkeys-imageio. Probably there are more 
but I tested this one with your image and the resulting AFP colors are 
indeed in the CMYK space. (note: get the twelvemonkeys source from the 
git repo, not from the svn).

Attached is your original sample_cmyk.jpg image, the same image with a 
CMYK ICC profile embedded, and two AFP outputs, the default output and 
the output using the twelvemonkeys ImageIO plugins. Attached is also the 
fop.xconf to use. There is apparently some bug in xmlgraphics that 
causes the JPEG image intrinsic resolution not to be respected if a ICC 
profile is embedded (the workaround is then to specify the 
source-resolution in the conf file).

On 5/21/13 12:26 AM, Luis Bernardo wrote:
> Thank you for an excellent set of test cases. I am afraid I know of no 
> workaround but I will investigate.
> On 5/20/13 10:11 AM, Luca Bellonda wrote:
>> >2013/5/17 Luis Bernardo
>> >This is a known issue (at least, I am familiar with it). I assume 
>> you are using jai_imageio.jar. The behavior is due to a bug in JAI 
>> (see http://www.java.net/node/702556)
>> Is there some known workaround?
>> >I was not aware of the issue you point out with RGB TIFFs and 
>> deflate compression. Can you provide example images with flate and 
>> LZW compression?
>> The material is available at the following address:
>> https://docs.google.com/file/d/0Bz0c5jBY0nL5alNNQUFrVF9DeEk/edit?usp=sharing&pli=1

>> Thank you

View raw message