net.sf.jomic.tools
Class ImageInfo

java.lang.Object
  extended by net.sf.jomic.tools.ImageInfo

public class ImageInfo
extends java.lang.Object

Information about size and format of an image. During construction, this information is obtained and later available via various getters. However, if the information cannot be obtained, hasError() is true and most getters won't be available. An exception of this is getError() which returs details about why the image information could not be obtained.

Author:
Thomas Aglassinger
See Also:
hasError(), getError()

Constructor Summary
ImageInfo(java.io.File newFile)
           
 
Method Summary
 java.lang.Throwable getError()
           
 java.io.File getFile()
          Return the file the image information was obtained from.
 java.lang.String getFormat()
          Get the name of the format of the image, for example "jpeg".
 int getHeight()
          Get the height of the image in pixels.
 java.awt.Dimension getSize()
          Get the size of the image in pixels.
 int getWidth()
          Get the width of the image in pixels.
 boolean hasError()
          Return true if the image is definitely broken, in other words either the format or the size could not be obtained.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageInfo

public ImageInfo(java.io.File newFile)
Method Detail

getError

public java.lang.Throwable getError()

getFile

public java.io.File getFile()
Return the file the image information was obtained from. This information is available even if hasError() is true.


getFormat

public java.lang.String getFormat()
Get the name of the format of the image, for example "jpeg". This is the format according to ImageIO, not the file suffix.


getHeight

public int getHeight()
Get the height of the image in pixels.


getSize

public java.awt.Dimension getSize()
Get the size of the image in pixels.


getWidth

public int getWidth()
Get the width of the image in pixels.


hasError

public boolean hasError()
Return true if the image is definitely broken, in other words either the format or the size could not be obtained.