JDK-6372670 : Incorrect JPEG encoding of images with alpha channel
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.imageio
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-01-14
  • Updated: 2011-01-19
  • Resolved: 2006-01-17
Related Reports
Duplicate :  
Description
The ImageIO JPEG encoder produces incorrect results for BufferedImages containing an alpha channel. The attached test shows the error. Run with "java JpegTest foo.jpg" e.g. on Windows and view the expected output. Then run with "java JpegTest -alpha foo2.jpg" and view the incorrect results. On Windows, Microsoft's default Picture Viewer will simply misinterpret the presence of the alpha channel and treat it as a color channel. On e.g. Solaris, xv won't open the resulting JPEG file.

It seems that the JPEG encoder used by ImageIO should either refuse to write images containing an alpha channel, or first discard the alpha channel if the file format can not handle it correctly.

Comments
EVALUATION Closing as a duplicate of 4836466, which itself was "not a bug". That bug report has more details about why we feel this is not a deficiency in the JDK.
17-01-2006

EVALUATION This problem seems to be a duplicate of 4836466.
16-01-2006