|
The im4java Library, Version 1.4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.im4java.core.Info
public class Info
This class implements an image-information object. The one-argument constructor expects a filename and parses the output of the "identify -verbose" command to create a hashtable of properties. This is the so called complete information. The two-argument constructor has a boolean flag as second argument. If you pass true, the Info-object only creates a set of so called basic information. This is more efficient since only a subset of the attributes of the image are requested and parsed.
Since the output of "identify -verbose" is meant as a human-readable interface and not for parsing, this class is inherently flawed. This implementation interprets every line with a colon as a key-value-pair. This is not necessarely correct, e.g. the comment-field could be multi-line with colons within the comment.
An alternative to the Info-class is to use the exiftool-command and the wrapper for it provided by im4java.
Constructor Summary | |
---|---|
Info(java.lang.String pImage)
This contstructor will automatically parse the full output of identify -verbose. |
|
Info(java.lang.String pImage,
boolean basic)
This constructor creates an Info-object with basic or complete image-information (depending on the second argument). |
|
Info(java.lang.String pImage,
java.io.InputStream pInput)
This contstructor will automatically parse the full output of identify -verbose. |
|
Info(java.lang.String pImage,
java.io.InputStream pInput,
boolean basic)
This constructor creates an Info-object with basic or complete image-information (depending on the third argument). |
Method Summary | |
---|---|
java.lang.String |
getImageClass()
Return the image class. |
java.lang.String |
getImageClass(int pSceneNr)
Return the image class for the given scene. |
int |
getImageDepth()
Return the image depth. |
int |
getImageDepth(int pSceneNr)
Return the image depth. |
java.lang.String |
getImageFormat()
Return the image format. |
java.lang.String |
getImageFormat(int pSceneNr)
Return the image format for the given scene. |
java.lang.String |
getImageGeometry()
Return the image geometry. |
java.lang.String |
getImageGeometry(int pSceneNr)
Return the image geometry for the given scene. |
int |
getImageHeight()
Return the image height. |
int |
getImageHeight(int pSceneNr)
Return the image height for the given scene. |
int |
getImageWidth()
Return the image width. |
int |
getImageWidth(int pSceneNr)
Return the image width for the given scene. |
java.lang.String |
getPageGeometry()
Return the page geometry. |
java.lang.String |
getPageGeometry(int pSceneNr)
Return the page geometry for the given scene. |
int |
getPageHeight()
Return the page height. |
int |
getPageHeight(int pSceneNr)
Return the page height for the given scene. |
int |
getPageWidth()
Return the page width. |
int |
getPageWidth(int pSceneNr)
Return the page width for the given scene. |
java.lang.String |
getProperty(java.lang.String pPropertyName)
Return the given property. |
java.lang.String |
getProperty(java.lang.String pPropertyName,
int pSceneNr)
Return the given property of the given scene. |
java.util.Enumeration<java.lang.String> |
getPropertyNames()
Return an enumeration of all properties. |
int |
getSceneCount()
Return the number of scenes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Info(java.lang.String pImage) throws InfoException
pImage
- Source image
InfoException
public Info(java.lang.String pImage, java.io.InputStream pInput) throws InfoException
pImage
- Name of the source-imagepInput
- Image provided as an InputStream
InfoException
public Info(java.lang.String pImage, boolean basic) throws InfoException
pImage
- Source imagebasic
- Set to true for basic information, to false for complete info
InfoException
public Info(java.lang.String pImage, java.io.InputStream pInput, boolean basic) throws InfoException
pImage
- Source imagebasic
- Set to true for basic information, to false for complete infopInput
- Image provided as an InputStream
InfoException
Method Detail |
---|
public java.lang.String getImageFormat()
public java.lang.String getImageFormat(int pSceneNr)
pSceneNr
- Scene-number (zero-based)public int getImageWidth() throws InfoException
InfoException
public int getImageWidth(int pSceneNr) throws InfoException
pSceneNr
- Scene-number (zero-based)
InfoException
public int getImageHeight() throws InfoException
InfoException
public int getImageHeight(int pSceneNr) throws InfoException
pSceneNr
- Scene-number (zero-based)
InfoException
public java.lang.String getImageGeometry()
public java.lang.String getImageGeometry(int pSceneNr)
pSceneNr
- Scene-number (zero-based)public int getImageDepth() throws InfoException
InfoException
public int getImageDepth(int pSceneNr) throws InfoException
pSceneNr
- Scene-number (zero-based)
InfoException
public java.lang.String getImageClass()
public java.lang.String getImageClass(int pSceneNr)
pSceneNr
- Scene-number (zero-based)public int getPageWidth() throws InfoException
InfoException
public int getPageWidth(int pSceneNr) throws InfoException
pSceneNr
- Scene-number (zero-based)
InfoException
public int getPageHeight() throws InfoException
InfoException
public int getPageHeight(int pSceneNr) throws InfoException
pSceneNr
- Scene-number (zero-based)
InfoException
public java.lang.String getPageGeometry()
public java.lang.String getPageGeometry(int pSceneNr)
pSceneNr
- Scene-number (zero-based)public java.lang.String getProperty(java.lang.String pPropertyName)
public java.lang.String getProperty(java.lang.String pPropertyName, int pSceneNr)
pPropertyName
- Name of the propertypSceneNr
- Scene-number (zero-based)public int getSceneCount()
public java.util.Enumeration<java.lang.String> getPropertyNames()
|
The im4java Library, Version 1.4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |