wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ImageIO JPG Problems/Bug??" Watch "ImageIO JPG Problems/Bug??" New topic
Author

ImageIO JPG Problems/Bug??

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.
Thanks.
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
Bartender

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.)


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

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ahh, there is actually transparancy in my GIF file I was testing with.
Thanks Nate - I will try a different test file.
 
 
subject: ImageIO JPG Problems/Bug??
 
Similar Threads
Error in Dowlnoading
Image Renderer for JTable
Write image to a file
How to create an Image
Displaying image on jsp