Class InferFromHeader
Object
AnchorBean<ImageMetadataReader>
ImageMetadataReader
InferFromHeader
public class InferFromHeader
extends ImageMetadataReader
Tries to construct the
ImageMetadata from EXIF and other metadata, if available, or
otherwise falls back to another reader.
It supports a limited number of file-types, as identified by an extension in the path. By default, it supports:
- JPEG (.jpg or .jpeg)
- PNG (.png)
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionInferFromHeader(ImageMetadataReader fallback, List<HeaderFormat> formats) Creates a newInferFromHeaderinstance. -
Method Summary
Modifier and TypeMethodDescriptionImageMetadataReaderFallback to use if EXIF information is non-existing or absent.The formats whose headers will be searched, to find sufficient metadata to populateImageMetadata.ImageMetadatavoidsetFallback(ImageMetadataReader fallback) Fallback to use if EXIF information is non-existing or absent.voidsetFormats(List<HeaderFormat> formats) The formats whose headers will be searched, to find sufficient metadata to populateImageMetadata.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
InferFromHeader
public InferFromHeader() -
InferFromHeader
Creates a newInferFromHeaderinstance.- Parameters:
fallback- Fallback to use if EXIF information is non-existing or absent.formats- The formats whose headers will be searched, to find sufficient metadata to populateImageMetadata.
-
-
Method Details
-
openFile
public ImageMetadata openFile(Path path, StackReader defaultStackReader, OperationContext context) throws ImageIOException - Specified by:
openFilein classImageMetadataReader- Throws:
ImageIOException
-
getFallback
public ImageMetadataReader getFallback()Fallback to use if EXIF information is non-existing or absent. -
setFallback
public void setFallback(ImageMetadataReader fallback) Fallback to use if EXIF information is non-existing or absent. -
getFormats
The formats whose headers will be searched, to find sufficient metadata to populateImageMetadata. -
setFormats
The formats whose headers will be searched, to find sufficient metadata to populateImageMetadata.
-