Exception reading a CMYK Jpeg
See original GitHub issueWhat steps will reproduce the problem?
1. Generate a CMYK JPG, call it selectedFile
1. Run Thumbnails.of(selectedFile).size(500, 500).toFile(thumb500File);
What is the expected output? What do you see instead?
Expected output - thumb500File created normally
Actual output: Exception raised "Incompatible color conversion"
What version of the product are you using? On what operating system? Which
version of Java (Sun/Oracle? OpenJDK?) ?
OpenJDK 7u9, Ubuntu Linux
Please provide any additional information below.
The core Java method ImageIO.read produces exactly the same exception, e.g.
BufferedImage originalImage = ImageIO.read(selectedFile);
so it looks like the issue is with Java, however other people have found
workarounds -
http://www.randelshofer.ch/blog/2011/08/reading-cmyk-jpeg-images-with-java-image
io/
Would it be possible to implement a workaround in Thumbnailator too? I think
the Java issue dates back some time.
A sample JPG exhibiting the problem is attached.
Original issue reported on code.google.com by oliver.k...@gmail.com
on 1 Nov 2012 at 12:59
Attachments:
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Reading CMYK jpeg images - Adobe Support Community
I gave up using ColdFusion-related image functions. I've still identified CMYK images that can't consistently be read by ColdFusion 10.
Read more >Unsupported image type?ImageIO can't read CMYK-encoded ...
Read a CMYK image into RGB BufferedImage. ... getImageReadersByFormatName("JPEG"); ImageReader reader = null; while(readers.
Read more >How can I tell if a JPEG is RGB or CMYK? - Quora
As a user, you can tell in a Mac with File->Get Info. Or you can open the file in Photoshop and look at...
Read more >Reading CMYK JPEG images with Java ImageIO - Randelshofer
Read an image with ImageIO.Unfortunately, the ImageIO.read method is not a reliable way for reading a JPEG CMYK image. ImageIO.read(file);. This ...
Read more >To preview the CMYK image with inverted color — oracle-tech
But the Jpeg image can be previewed with inverted color if the image is in CMYK color mode. The preview is wokring correctly...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Original comment by
coobird...@gmail.com
on 21 Sep 2014 at 10:41Support for CMYK JPEGs would require writing a JPEG reader that supports it, which is outside the scope of Thumbnailator. (Thumbnailator is a wrapper around the Java 2D and Image I/O APIs.)
TwelveMonkeys ImageIO provides an excellent alternative to Java’s default JPEG reader/writer, which can deal with CMYK JPEGs