File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes ImageIO JPG Problems/Bug?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ImageIO JPG Problems/Bug??" Watch "ImageIO JPG Problems/Bug??" New topic

ImageIO JPG Problems/Bug??

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Is there a bug or a problem in writing JPG images using the ImageIO API?
My code is as follows:

The problem is that the new JPG image seems to be almost a negative of the GIF image.
Does anyone know how to resolve this? I did read that there was a bug in the ImageIO with Compressing JPG's, but didn't think that would affect my code. But I am not sure.
BTW - if my oldImg is a JPEG file and I write a JPEG file, I don't have a problem. Appearntly it is only in converting from GIF to JPG. I also don't have a problem going from JPG to PNG either.
[ December 26, 2002: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Hmmm... I tried this out... are you trying to convert a gif that uses transparency or animation? The jpeg images that were produced by trying to convert these were pretty screwed up. Most normal gifs are converting OK though... (not that I've tried this with a considerable amount... ~5 or so, so there may be other issues.)

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Ahh, there is actually transparancy in my GIF file I was testing with.
Thanks Nate - I will try a different test file.
I agree. Here's the link:
subject: ImageIO JPG Problems/Bug??
It's not a secret anymore!