2 Replies Latest reply on Sep 23, 2007 1:25 PM by Waseem Quraishi

    org.jboss.seam.ui.graphicImage.Image problem with scaling gi

    schmod54 Newbie

      I'm using seam's image class to resize images into thumbnail files... the code works perfectly for jpegs and pngs, but gifs seem to get turned into just transparent images. Is there some special treatment of gifs, or is this a bug with seam? Here's a snippet of the relevant code:

      import org.jboss.seam.ui.graphicImage.Image;
      ...
      InputStream is = ...initialized from fileUpload...
      Image thumb = new Image();
      thumb.setInput(is);
      if (thumb.getWidth() > thumb.getHeight())
       thumb.scaleToWidth(MAX_THUMB_SIZE);
      else
       thumb.scaleToHeight(MAX_THUMB_SIZE);
      
      File thumbFile = new File(uploadFilePrefix, thumbFilename);
      files.add(thumbFile);
      fos = new FileOutputStream(thumbFile);
      fos.write(thumb.getImage());
      fos.close();