Class ExtentReader
Object
ExtentReader
Reads an
Extent from the Metadata tags of a file.-
Method Summary
-
Method Details
-
read
public static <T extends com.drew.metadata.Directory> Optional<Extent> read(com.drew.metadata.Metadata metadata, Class<T> directoryType, int tagWidth, int tagHeight) throws ImageIOException Reads two metadata entries, representing width and height, and use them to form aExtent.The first directory of type
directoryTypeis used for the tags.- Type Parameters:
T- directory-type to find- Parameters:
metadata- the metadata to read from.directoryType- class corresponding toT.tagWidth- a unique identifier from the metadata-extractor library identifying the width tag.tagHeight- a unique identifier from the metadata-extractor library identifying the height tag.- Returns:
- the value of the tag, or
Optional.empty()if it does not exist. - Throws:
ImageIOException- if the metadata is errored (but not if it is absent).
-
read
public static Optional<Extent> read(com.drew.metadata.Directory directory, int tagWidth, int tagHeight) throws ImageIOException Reads two metadata entries, representing width and height, and use them to form aExtent.- Parameters:
directory- the directory to read tags from.tagWidth- a unique identifier from the metadata-extractor library identifying the width tag.tagHeight- a unique identifier from the metadata-extractor library identifying the height tag.- Returns:
- the value of the tag, or
Optional.empty()if it does not exist. - Throws:
ImageIOException- if the metadata is errored (but not if it is absent).
-