• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic