Class LocationReader
Object
LocationReader
Reads the GPS location from EXIF metadata, if specified in an image-file.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<ImageLocation> readLocation
(com.drew.metadata.Metadata metadata) Reads the image-location from geolocation metadata-tags, if they are present in the metadata.static Optional
<ImageLocation> readLocation
(Path path) Reads the image-location from geolocation metadata-tags, if they are present in an image.
-
Method Details
-
readLocation
Reads the image-location from geolocation metadata-tags, if they are present in an image.If more than one GpsDirectory exists in the metadata, the first encountered is returned. This is assumed to be an extremely rare (possibly illegal) state.
- Parameters:
path
- the path to the image that may or may not contain geolocation metadata.- Returns:
- the image-location, iff it can be determined.
- Throws:
ImageIOException
- if the metadata cannot be read.
-
readLocation
Reads the image-location from geolocation metadata-tags, if they are present in the metadata.If more than one GpsDirectory exists in the metadata, the first encountered is returned. This is assumed to be an extremely rare (possibly illegal) state.
- Parameters:
metadata
- the metadata to read from.- Returns:
- the image-location, iff it exists in the metadata.
-