public abstract class HeaderFormat extends AnchorBean<HeaderFormat>
ImageMetadata
from the header of an image-file.
The metadata-extractor from Drew Noakes is used to read the metadata.
Constructor and Description |
---|
HeaderFormat() |
Modifier and Type | Method and Description |
---|---|
protected abstract ImageFileFormat |
format()
The associated
ImageFileFormat with this header. |
Optional<ImageMetadata> |
populateFrom(Path path)
Creates a
ImageMetadata , if possible, from the metadata at path . |
protected abstract Optional<ImageMetadata> |
populateFromMetadata(com.drew.metadata.Metadata metadata,
ImageFileAttributes attributes)
Creates a
ImageMetadata , if possible, from metadata . |
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public Optional<ImageMetadata> populateFrom(Path path) throws ImageIOException
ImageMetadata
, if possible, from the metadata at path
.path
- the path to an image file.path
, if it was possible to infer it.ImageIOException
- if the metadata does not meet expectations or I/O fails.protected abstract ImageFileFormat format()
ImageFileFormat
with this header.
Only files whose paths end with an extension for this format will be accepted.
protected abstract Optional<ImageMetadata> populateFromMetadata(com.drew.metadata.Metadata metadata, ImageFileAttributes attributes) throws ImageIOException
ImageMetadata
, if possible, from metadata
.metadata
- the Metadata
to infer ImageMetadata
from.attributes
- timestamps and other file-attributes associated with the metadata.ImageIOException
- if the metadata does not meet expectations.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.