public class AcquisitionDateReader extends Object
Modifier and Type | Method and Description |
---|---|
static Optional<java.time.ZonedDateTime> |
readAcquisitionDate(com.drew.metadata.Metadata metadata)
Reads an image acquisition-date from metadata, based on the present of EXIF data.
|
static Optional<java.time.ZonedDateTime> |
readAcquisitionDate(Path path)
Reads an image acquisition-date from a file identified by path, based on the present of EXIF
data.
|
public static Optional<java.time.ZonedDateTime> readAcquisitionDate(Path path) throws ImageIOException
Only files with extensions matching JPEG or TIFF are checked.
Three different EXIF tags are tried in a particular order, and the first existing tag is treated as the acqusition date:
ExifDirectoryBase.TAG_DATETIME
ExifDirectoryBase.TAG_DATETIME_ORIGINAL
ExifDirectoryBase.TAG_DATETIME_DIGITIZED
path
- the path to the image.ImageIOException
- if the metadata is errored (but not if metadata is absent).public static Optional<java.time.ZonedDateTime> readAcquisitionDate(com.drew.metadata.Metadata metadata)
The same procedure is used as in readAcquisitionDate(Path)
.
metadata
- the metadata.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.