Open tfga opened 7 years ago
Hi @tfga I did some research on this issue (finally) and it appears the problem is two fold. Firstly the Java standard library does not support JPEGs with indexed colors. Secondly, even if it did the PDF JPEG code is basic and does not support outputting custom indexed color spaces.
I would suggest you convert the image to either RGB, CMYK or greyscale before embedding in the document. I believe this can be done with the TwelveMonkeys JPEG plugin or a variety of image tools in other prgramming languages.
Hi, @danfickle,
Thank you for your comment!
Unfortunately, the HTML I'm trying to convert comes from another organization... we don't have much control over it. I would have to extract this embedded image, make the conversion you mention and then replace the <img>
element in the original document...
Hum. Maybe this is feasible. I'll give it a try.
Thanks again for you answer, for your research and for the pointer to the TwelveMonkeys JPEG plugin. I'll look into it. :+1:
Hi,
This error occurs when I try to convert an HTML with a specific embedded base64-encoded image. Here's what I believe is the relevant part of the stack trace:
Close to the point where the exception is thrown, I found this comment:
outColorSpaceCode == 4
, which corresponds toJPEG.JCS_CMYK
-- one of the unsupported color models, apparently.This is the image in question: