Class HeaderFormat
Populates
ImageMetadata from the header of an image-file.
The metadata-extractor from Drew Noakes is used to read the metadata.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ImageFileFormatformat()The associatedImageFileFormatwith this header.populateFrom(Path path) Creates aImageMetadata, if possible, from the metadata atpath.protected abstract Optional<ImageMetadata> populateFromMetadata(com.drew.metadata.Metadata metadata, ImageFileAttributes attributes) Creates aImageMetadata, if possible, frommetadata.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
HeaderFormat
public HeaderFormat()
-
-
Method Details
-
populateFrom
Creates aImageMetadata, if possible, from the metadata atpath.- Parameters:
path- the path to an image file.- Returns:
- the metadata associated with
path, if it was possible to infer it. - Throws:
ImageIOException- if the metadata does not meet expectations or I/O fails.
-
format
The associatedImageFileFormatwith this header.Only files whose paths end with an extension for this format will be accepted.
- Returns:
- the format.
-
populateFromMetadata
protected abstract Optional<ImageMetadata> populateFromMetadata(com.drew.metadata.Metadata metadata, ImageFileAttributes attributes) throws ImageIOException Creates aImageMetadata, if possible, frommetadata.- Parameters:
metadata- theMetadatato inferImageMetadatafrom.attributes- timestamps and other file-attributes associated with the metadata.- Returns:
- the inferred metadata, if it was possible to infer it.
- Throws:
ImageIOException- if the metadata does not meet expectations.
-