public final class ExifReader extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
ExifReader() |
Modifier and Type | Method and Description |
---|---|
static java.awt.geom.AffineTransform |
getRestoreOrientationTransform(int orientation,
int width,
int height)
Returns a Transform that fixes the image orientation.
|
static boolean |
orientationNeedsCorrection(int orientation)
Check, if the given orientation requires any correction to the image.
|
static boolean |
orientationSwitchesDimensions(int orientation)
Check, if the given orientation switches width and height of the image.
|
private static double |
readAxis(GpsDirectory dirGps,
int gpsTag,
int gpsTagRef,
char cRef) |
static java.lang.Double |
readDirection(java.io.File filename)
Returns the direction of the given JPEG file.
|
static java.lang.Double |
readDirection(GpsDirectory dirGps)
Returns the direction of the given EXIF GPS directory.
|
static LatLon |
readLatLon(java.io.File filename)
Returns the geolocation of the given JPEG file.
|
static LatLon |
readLatLon(GpsDirectory dirGps)
Returns the geolocation of the given EXIF GPS directory.
|
static java.lang.Integer |
readOrientation(java.io.File filename)
Returns the image orientation of the given JPEG file.
|
static java.util.Date |
readTime(java.io.File filename)
Returns the date/time from the given JPEG file.
|
private ExifReader()
public static java.util.Date readTime(java.io.File filename) throws java.text.ParseException
filename
- The JPEG file to readnull
if not foundjava.text.ParseException
- if PrimaryDateParser.parse(java.lang.String)
fails to parse date/timepublic static java.lang.Integer readOrientation(java.io.File filename)
filename
- The JPEG file to readint
. Default value is 1. Possible values are listed in EXIF spec as follows:public static LatLon readLatLon(java.io.File filename)
filename
- The JPEG file to readnull
if not foundpublic static LatLon readLatLon(GpsDirectory dirGps) throws MetadataException
dirGps
- The EXIF GPS directorynull
if dirGps
is nullMetadataException
- if invalid metadata is givenpublic static java.lang.Double readDirection(java.io.File filename)
filename
- The JPEG file to readnull
if missing or if dirGps
is nullpublic static java.lang.Double readDirection(GpsDirectory dirGps)
dirGps
- The EXIF GPS directorynull
if missing or if dirGps
is nullprivate static double readAxis(GpsDirectory dirGps, int gpsTag, int gpsTagRef, char cRef) throws MetadataException
MetadataException
public static java.awt.geom.AffineTransform getRestoreOrientationTransform(int orientation, int width, int height)
orientation
- the exif-orientation of the imagewidth
- the original width of the imageheight
- the original height of the imagepublic static boolean orientationSwitchesDimensions(int orientation)
orientation
- the exif-orientation of the imagepublic static boolean orientationNeedsCorrection(int orientation)
orientation
- the exif-orientation of the image