• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Resizing a gif

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have the following piece of code and it does not work with GIFs. It simply produces a 0ko image. It works fine with JPGs.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ImageIO.write returns a boolean indicating success/failure. If you had checked it you would see false here. The J2SE ships with a GIF reader but not a GIF writer. That's because of copywrite issues some time ago, but the copywrite has since expired. There are several 3rd party gif writers out there: google for them. You can also download and install Sun's JAI Java(TM) Image I/O API which provides more reader/writer plug-ins for ImageIO. In the documentation for it:

http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_0_01-fcs-docs/index.html

It states:

An ImageWriter plug-in is provided for the Graphics Interchange Format (GIF). Animated GIF images may be created using the standard sequence writing methods defined in ImageWriter. By default the writer creates version "89a" images.

[ February 09, 2006: Message edited by: Jeff Albertson ]
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic