• Post Reply Bookmark Topic Watch Topic
  • New Topic

ImageIO.write() with "JPG" doesn't work

 
Geon Goo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JDK 1.4 with MS-Windows 2000 Korean version.
I tried ImageIO.write(). it works with "PNG" but, "JPG" and "GIF" doesn't.
source code is very simple.

above code works fine. but when I change output file name as "duke.jpg" and ImageIO.write(img,"JPG",outFile)--> it doesn't work.
GIF doesn't work either.
does anyone know this?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From a pdf file from JavaOne it looks like ImageIO supports "PNG", "JPEG", and "GIF" as options... it says that GIF is read only... I would guess due to the retarded LZW "patent"...

It looks like the ImageIO API can be extended to support other file formats pretty easily... so it should be pretty easy to write your own image readers and writers if you need to...

-Nate
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!