Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong JPEG color space #59

Closed
azhuchkov opened this issue Sep 2, 2014 · 2 comments
Closed

Wrong JPEG color space #59

azhuchkov opened this issue Sep 2, 2014 · 2 comments

Comments

@azhuchkov
Copy link

Apparently TwelveMonkeys and JDK have exchanged seats: the com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader confuses JPEG color space while JDK produces adequate result.

The test:

val img = ImageIO.read(new File("/home/andrey/Downloads/tailand.jpg"))
ImageIO.write(img, "JPG", new File("/tmp/thumbnail.jpg"))

Original image (link):
tailand
Result:
thumbnail

java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

TwelveMonkeys: 3.0-rc5
@haraldk
Copy link
Owner

haraldk commented Sep 3, 2014

Hi Andrey,

Thank you for reporting and providing a test sample. I can reproduce the problem here as well.

The reason why my reader is confused, is because the JPEG file has non-standard component id's (0, 1, 2, instead of the standard 1, 2, 3) and does not use chroma subsampling.

However, it does have a valid JFIF segment, so it should still be considered to be in YCbCr and not RGB.

I'll see what I can do about that. :-)

Harald K

@haraldk haraldk added the Bug label Sep 3, 2014
@haraldk haraldk added this to the 3.0 release milestone Sep 3, 2014
@haraldk
Copy link
Owner

haraldk commented Sep 3, 2014

Hi again,

Can you please test a build of the latest snapshot? I believe this behavior was already changed as part of the fix for issue #38, and should fix your problem.

Update: I did a quick test and it seems to work fine, so I'm closing this as duplicate.

Harald K

@haraldk haraldk closed this as completed Sep 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants