Java 1.5.0_16 corrupted colours when saving jpg image

Posted by Coder on Stack Overflow See other posts from Stack Overflow or by Coder
Published on 2010-05-02T14:21:38Z Indexed on 2010/05/02 14:27 UTC
Read the original article Hit count: 312

Filed under:
|
|

Hi, i have a loaded image from disk (stored as a BufferedImage), which i display correctly on a JPanel but when i try to re-save this image using the command below, the image is saved in a reddish hue.

ImageIO.write(image, "jpg", fileName);

Note! image is a BufferedImage and fileName is a File object pointing to the filename that will be saved which end in ".jpg".

I have read that there were problems with ImageIO methods in earlier JDKs but i'm not on one of those versions as far as i could find. What i am looking for is a way to fix this issue without updating the JDK, however having said that i would still like to know in what JDK this issue was fixed in (if it indeed is still a bug with the JDK i'm using).

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about imageio