public class EXIFReader extends Object
Creates a tree
structure of DefaultMutableTreeNodes. Nodes with a String user object
describe the hierarchy of the meta data. Nodes with an MetaDataEntry as user
object hold the actual meta data.
Sources:
Exchangeable image file format for digital still cameras: EXIF Version 2.2. (April, 2002). Standard of Japan Electronics and Information Technology Industries Association. JEITA CP-3451. http://www.exif.org/Exif2-2.PDF
Multi-Picture Format (February 4, 2009). Standard of the Camera & Imaging Products Association. CIPA DC-007-Translation-2009. http://www.cipa.jp/english/hyoujunka/kikaku/pdf/DC-007_E.pdf
| Constructor and Description |
|---|
EXIFReader(File f) |
EXIFReader(ImageInputStream iin) |
| Modifier and Type | Method and Description |
|---|---|
ArrayList<TIFFDirectory> |
getDirectories(int image,
TagSet tagSet)
Returns all IFDDirectories of the specified tag set for the given image.
|
IIOMetadata |
getIIOMetadata(int i) |
IIOMetadataNode |
getIIOMetadataTree(String formatName,
int imageIndex)
Gets the metadata as an ImageIO structure.
|
int |
getImageCount()
Returns the number of images that are described with EXIF.
|
HashMap<TIFFTag,TIFFField> |
getMetaDataMap()
Returns a flat hash map of the metadata.
|
TIFFNode |
getMetaDataTree()
Gets the meta data as a Swing TreeNode structure.
|
ArrayList<BufferedImage> |
getThumbnails(boolean suppressException)
Returns all thumbnails.
|
boolean |
isFirstImageOnly() |
boolean |
isIncludeContainerMetadata() |
void |
read()
Reads the meta data from the file or input stream that has been set on
the constructor.
|
void |
readAVIstrdChunk(byte[] data)
Reads the Exif metadata from an AVI RIFF file.
|
void |
setFirstImageOnly(boolean b) |
void |
setIncludeContainerMetadata(boolean b) |
public EXIFReader(File f)
public EXIFReader(ImageInputStream iin)
public void setFirstImageOnly(boolean b)
public boolean isFirstImageOnly()
public void setIncludeContainerMetadata(boolean b)
public boolean isIncludeContainerMetadata()
public void read()
throws IOException
IOExceptionpublic void readAVIstrdChunk(byte[] data)
throws IOException
IOExceptionpublic TIFFNode getMetaDataTree()
public int getImageCount()
public ArrayList<TIFFDirectory> getDirectories(int image, TagSet tagSet)
public ArrayList<BufferedImage> getThumbnails(boolean suppressException) throws IOException
IOExceptionpublic HashMap<TIFFTag,TIFFField> getMetaDataMap()
public IIOMetadataNode getIIOMetadataTree(String formatName, int imageIndex)
Format description replicated from http://download.java.net/media/jai-imageio/javadoc/1.1/com/sun/media/imageio/plugins/tiff/package-summary.html:
The DTD for the native image metadata format is as follows:
The DTD for the native image metadata format is as follows:
<!DOCTYPE "com_sun_media_imageio_plugins_tiff_image_1.0" [
<!ELEMENT "com_sun_media_imageio_plugins_tiff_image_1.0" (TIFFIFD)*>
<!ELEMENT "TIFFIFD" (TIFFField | TIFFIFD)*>
<!-- An IFD (directory) containing fields -->
<!ATTLIST "TIFFIFD" "tagSets" #CDATA #REQUIRED>
<!-- Data type: String -->
<!ATTLIST "TIFFIFD" "parentTagNumber" #CDATA #IMPLIED>
<!-- The tag number of the field pointing to this IFD -->
<!-- Data type: Integer -->
<!ATTLIST "TIFFIFD" "parentTagName" #CDATA #IMPLIED>
<!-- A mnemonic name for the field pointing to this IFD, if known
-->
<!-- Data type: String -->
<!ELEMENT "TIFFField" (TIFFBytes | TIFFAsciis |
TIFFShorts | TIFFSShorts | TIFFLongs | TIFFSLongs |
TIFFRationals | TIFFSRationals |
TIFFFloats | TIFFDoubles | TIFFUndefined)>
<!-- A field containing data -->
<!ATTLIST "TIFFField" "number" #CDATA #REQUIRED>
<!-- The tag number asociated with the field -->
<!-- Data type: String -->
<!ATTLIST "TIFFField" "name" #CDATA #IMPLIED>
<!-- A mnemonic name associated with the field, if known -->
<!-- Data type: String -->
<!ELEMENT "TIFFBytes" (TIFFByte)*>
<!-- A sequence of TIFFByte nodes -->
<!ELEMENT "TIFFByte" EMPTY>
<!-- An integral value between 0 and 255 -->
<!ATTLIST "TIFFByte" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ATTLIST "TIFFByte" "description" #CDATA #IMPLIED>
<!-- A description, if available -->
<!-- Data type: String -->
<!ELEMENT "TIFFAsciis" (TIFFAscii)*>
<!-- A sequence of TIFFAscii nodes -->
<!ELEMENT "TIFFAscii" EMPTY>
<!-- A String value -->
<!ATTLIST "TIFFAscii" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ELEMENT "TIFFShorts" (TIFFShort)*>
<!-- A sequence of TIFFShort nodes -->
<!ELEMENT "TIFFShort" EMPTY>
<!-- An integral value between 0 and 65535 -->
<!ATTLIST "TIFFShort" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ATTLIST "TIFFShort" "description" #CDATA #IMPLIED>
<!-- A description, if available -->
<!-- Data type: String -->
<!ELEMENT "TIFFSShorts" (TIFFSShort)*>
<!-- A sequence of TIFFSShort nodes -->
<!ELEMENT "TIFFSShort" EMPTY>
<!-- An integral value between -32768 and 32767 -->
<!ATTLIST "TIFFSShort" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ATTLIST "TIFFSShort" "description" #CDATA #IMPLIED>
<!-- A description, if available -->
<!-- Data type: String -->
<!ELEMENT "TIFFLongs" (TIFFLong)*>
<!-- A sequence of TIFFLong nodes -->
<!ELEMENT "TIFFLong" EMPTY>
<!-- An integral value between 0 and 4294967295 -->
<!ATTLIST "TIFFLong" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ATTLIST "TIFFLong" "description" #CDATA #IMPLIED>
<!-- A description, if available -->
<!-- Data type: String -->
<!ELEMENT "TIFFSLongs" (TIFFSLong)*>
<!-- A sequence of TIFFSLong nodes -->
<!ELEMENT "TIFFSLong" EMPTY>
<!-- An integral value between -2147483648 and 2147482647 -->
<!ATTLIST "TIFFSLong" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ATTLIST "TIFFSLong" "description" #CDATA #IMPLIED>
<!-- A description, if available -->
<!-- Data type: String -->
<!ELEMENT "TIFFRationals" (TIFFRational)*>
<!-- A sequence of TIFFRational nodes -->
<!ELEMENT "TIFFRational" EMPTY>
<!-- A rational value consisting of an unsigned numerator and
denominator -->
<!ATTLIST "TIFFRational" "value" #CDATA #IMPLIED>
<!-- The numerator and denominator, separated by a slash -->
<!-- Data type: String -->
<!ELEMENT "TIFFSRationals" (TIFFSRational)*>
<!-- A sequence of TIFFSRational nodes -->
<!ELEMENT "TIFFSRational" EMPTY>
<!-- A rational value consisting of a signed numerator and
denominator -->
<!ATTLIST "TIFFSRational" "value" #CDATA #IMPLIED>
<!-- The numerator and denominator, separated by a slash -->
<!-- Data type: String -->
<!ELEMENT "TIFFFloats" (TIFFFloat)*>
<!-- A sequence of TIFFFloat nodes -->
<!ELEMENT "TIFFFloat" EMPTY>
<!-- A single-precision floating-point value -->
<!ATTLIST "TIFFFloat" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ELEMENT "TIFFDoubles" (TIFFDouble)*>
<!-- A sequence of TIFFDouble nodes -->
<!ELEMENT "TIFFDouble" EMPTY>
<!-- A double-precision floating-point value -->
<!ATTLIST "TIFFDouble" "value" #CDATA #IMPLIED>
<!-- The value -->
<!-- Data type: String -->
<!ELEMENT "TIFFUndefined" EMPTY>
<!-- Uninterpreted byte data -->
<!ATTLIST "TIFFUndefined" "value" #CDATA #IMPLIED>
<!-- A list of comma-separated byte values -->
<!-- Data type: String -->
]>
public IIOMetadata getIIOMetadata(int i)
Copyright © 2014. All Rights Reserved.