org.objectweb.jac.util
Class Images

java.lang.Object
  |
  +--org.objectweb.jac.util.Images

public class Images
extends Object

Contains various methods related to image files


Field Summary
protected static byte[] GIF87A_SIG
           
protected static byte[] GIF89A_SIG
           
protected static byte[] JFIF_SIG
           
protected static byte[] PNG_SIG
           
 
Constructor Summary
Images()
           
 
Method Summary
static Dimension getImageFileSize(File img)
          Tells the size of an image.
static Dimension getImageSize(InputStream img)
          Tells the size of an image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PNG_SIG

protected static final byte[] PNG_SIG

GIF87A_SIG

protected static final byte[] GIF87A_SIG

GIF89A_SIG

protected static final byte[] GIF89A_SIG

JFIF_SIG

protected static final byte[] JFIF_SIG
Constructor Detail

Images

public Images()
Method Detail

getImageFileSize

public static Dimension getImageFileSize(File img)
                                  throws IOException
Tells the size of an image. Supported formats are GIF and PNG.

Parameters:
img - the file of the image
Returns:
The size of the image, null if the image format is unhandled
IOException
See Also:
getImageSize(InputStream)

getImageSize

public static Dimension getImageSize(InputStream img)
                              throws IOException
Tells the size of an image. Supported formats are GIF and PNG.

Parameters:
img - the data of the image
Returns:
The size of the image, null if the image format is unhandled
IOException
See Also:
getImageFileSize(File)