title: Why would java.awt.image.BufferedImage#getType return different value Mac & CENTOS
body: <p>I have a question about the <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/awt/image/BufferedImage.html#getType%28%29" rel="nofollow">BufferedImage#getType</a> method. When referencing a PNG image from the file system, the following code will print <strong>5</strong> in my Mac and <strong>0</strong> in a CENTOS box with this JVM:</p>
  
  <p>java version "1.6.0_03"
  Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
  Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-b05, mixed mode)</p>
  
  <pre><code>import java.awt.*;
  import java.awt.geom.AffineTransform;
  import java.awt.image.BufferedImage;
  import javax.imageio.ImageIO;
  import java.io.*;
  
  public class ImageTypeTest {
  
     public static void main(String[] args) throws Exception{
        BufferedImage sourceImage = ImageIO.read(new File("/path/to/png.png"));
        System.out.println(sourceImage.getType());
     }
  
  }
  </code></pre>
  
  <p>Can anyone please shed some light as to what might be causing this difference so that I can work around it? The code returns the same values for other image types, say GIF images.</p>
  
  <p>Thank you</p>