PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 16:15 
Hello,
my original HTML document has an image and I get the next Exception when I do pd4ml.render(...) :

sun.awt.image.ImageFormatException: Unsupported color conversion request

I tried by changing the image by another with similar width and height but less file size (the original image that fails is 138 KB and the new one is 14KB). When I change it, it works fine.

How can I make it to work with the original size image? It has to be this image because it is from an external server and I cannot change the quality or size.

Thanks


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 16:33 
An image sample and corresponding HTML snippet would help a lot to reproduce the issue on our side.


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 16:36 
Yeah... but by privacy rules of my company I cannot publish the HTML and/or the image in a public topic.

Can I send you an e-mail with them?


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 16:37 
Of course. Please send it to support pd4ml com


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 16:46 
Thank you, I've sent you an e-mail.

Tell me if you have problems to open it.


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 17:11 
In order to resolve the issue you would need to convert the hi-res image from CMYK to RGB. CMYK images are not natively supported by Java

The lo-res image is already RGB, so it appears in PDF correctly

We plan to add CMYK support to the forthcoming version of our product, but it will take 1-1.5 months.


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 17:17 
Oh, ok... so I cannot do anything now because the picture URL is in an external server and I cannot manage it. The image will change depending the user selection so I cannot save and modify the picture in my own server.

Thank you so much and I will try it again in some months.

Thank you again.


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 04 Jan 2011, 17:31 
It is probably a bit tricky, but you may implement on-a-fly image converter utilizing PD4ML custom resource loader technique
post43.html
and JAI library.


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 05 Jan 2011, 11:05 
Hello,
I am investigating it... I did some tests and when I check the next condition:

img.getColorModel().getColorSpace().getType() == ColorSpace.TYPE_CMYK

I get always false. Debugging my code, I see that the color space is returned as RGB, so this condition cannot be true.

To arrive to this point, I get the image from the external server and I save it in my local server. It is recommended that the final solution doesn't do that and work always in memory without save temp files.

The picture saved in my hard drive has wrong colours.

I'm a bit lost.


  Subject: Re: sun.awt.image.ImageFormatException: Unsupported color conver
   PostPosted: 05 Jan 2011, 14:21 
I opened the hi-res image in Photoshop and made sure: the image color space is CMYK.

> img.getColorModel().getColorSpace().getType() == ColorSpace.TYPE_CMYK
The request would make sense if you have a correctly instantiated Image object. But in your case it has internally thrown a sun.awt.image.ImageFormatException. So I suspect "img" object has default values of some properties.

If I have time today or tomorrow I'll try to create for you an "on-a-fly" converter from CMYK to RGB



[Reply]     [ 20 posts ]  Go to page 1, 2  Next

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share