JDK-8214035 : Unable to render cmyk jpeg image
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 7u211,8u201,openjfx12
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-19
  • Updated: 2020-01-31
  • Resolved: 2018-12-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u211Fixed 8u201Fixed openjdk8u212Fixed
Related Reports
Relates :  
Relates :  
ImageView is not rendering the attached image after JDK-8203884
Changeset: 0e8471a4ad56 Author: arapte Date: 2018-12-06 14:04 +0530 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/0e8471a4ad56 8214035: Unable to render cmyk jpeg image Reviewed-by: kcr, jdv

webrev.01 is fine. +1. Good to see UPDATING.txt added it will help future updates.

Approved to push to 8u-dev.

The .01 webrev looks good. I confirm that it fixes the problem, and all other testing it good. +1

Hi Kevin, Thanks for the review comments. Please take a look at the updated webrev: http://cr.openjdk.java.net/~arapte/fx/8214035/webrev.01/

In jdcolor.c, the following code was not inserted in the right place: break; default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); } + case JCS_YCCK: + cconvert->pub.color_convert = ycck_rgb_convert; + build_ycc_rgb_table(cinfo); + break; + case JCS_CMYK: + cconvert->pub.color_convert = cmyk_rgb_convert; + break; break; default: ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); } break; These case statements of "switch (cinfo->jpeg_color_space)" should be after the "break" for the (inner) JCS_RGB case. As it is this will fall-through from the previous case into the JCS_YCCK block (and causes a duplicate break statement after the JCS_CMYK block).

One more comment: To avoid the possibility of missing this again the next time we update libjpeg, please add a README file along-side the sources indicating our local modifications that need to be ported each time we upgrade. I suggest something like this, which matches what is done for freetype and libpng. modules/javafx.graphics/src/main/native-iio/libjpeg/UPDATING.txt Notes for updating libjpeg in JavaFX ------------------------------------ The following files contain local modifications of libjpeg for JavaFX: * jchuff.c * jcmaster.c * jdcolor.c * jdhuff.c * jmorecfg.h <describe the changes here>

Hi Kevin & Jay, Please take a look at this fix which imports the missing changes from fx libjpeg7 to libjpeg9c. http://cr.openjdk.java.net/~arapte/fx/8214035/webrev.00/ These native changes were missed while updating libjpeg to 9c. This particular issue gets fixed with the changes in jdcolor.c. This was earlier fixed for libjpeg7, under JDK-8096615 [Test was missed here] Rest of the changes in other files are imported as is from fx libjpeg7 source. Verified that none of the test fail.

This seems a serious regression then. Raising the priority to P2.

Tried same as Arun, jfx-dev with JDK-8203884 : Issue occurs jfx-dev without JDK-8203884 : Issue does not occur

Windows Openjfx11.0.1 downloaded from https://gluonhq.com/products/javafx/ : Issue does not occur Openjfx12-ea+2 downloaded from https://gluonhq.com/products/javafx/ : Issue occurs JDK 9 GA : Issue occurs

[~kcr], I'm yet to try on Windows, however on my mac, ImageView is able to render cmyk image without JDK-8203884. Actually I had found this when running a WebKit test(fast/images/cmyk-jpeg-with-color-profile.html)

I downloaded the attached image, and it doesn't display for me (on Windows at least) even with JDK 8u192 or with openjfx11, neither of which have the fix for JDK-8203884.

This seems like a pretty serious regression. How common a case do you think this is?