title: Why does this GIF end up as a black square when resizing with Java ImageIO
body: <p>Java ImageIO correctly displays this black &amp; white image <a href="http://www.jthink.net/jaikoz/scratch/black.gif" rel="nofollow">http://www.jthink.net/jaikoz/scratch/black.gif</a> but when I try and resize it using this code</p>
  
  <pre><code>public static BufferedImage resize2D(Image srcImage, int size)
  {
      int w = srcImage.getWidth(null);
      int h = srcImage.getHeight(null);
  
      // Determine the scaling required to get desired result.
      float scaleW = (float) size / (float) w;
      float scaleH = (float) size / (float) h;
  
      MainWindow.logger.finest("Image Resizing to size:" + size + " w:" + w + ":h:" + h + ":scaleW:" + scaleW + ":scaleH" + scaleH);
  
      //Create an image buffer in which to paint on, create as an opaque Rgb type image, it doesn't matter what type
      //the original image is we want to convert to the best type for displaying on screen regardless
      BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
  
      // Set the scale.
      AffineTransform tx = new AffineTransform();
      tx.scale(scaleW, scaleH);
  
      // Paint image.
      Graphics2D g2d = bi.createGraphics();
                      g2d.setComposite(AlphaComposite.Src);
      g2d.drawImage(srcImage, tx, null);
      g2d.dispose();
      return bi;
  }
  </code></pre>
  
  <p>I just end up with a black image. Im trying to make the image smaller (a thumbnail) but even if I resize it larger for test purposes it still ends up as a black square.</p>
  
  <p>Other images resize okay, anyone know what is the problem with the gif/and or Java Bug</p>