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(com.drew.metadata.exif.GpsDirectory dirGps,
int gpsTag,
int gpsTagRef,
char cRef) |
static java.lang.String |
readCaption(com.drew.metadata.iptc.IptcDirectory dirIptc)
Returns the caption of the given IPTC directory.
|
static java.lang.Double |
readDirection(java.io.File filename)
Returns the direction of the given JPEG file.
|
static java.lang.Double |
readDirection(com.drew.metadata.exif.GpsDirectory dirGps)
Returns the direction of the given EXIF GPS directory.
|
static java.lang.Double |
readElevation(java.io.File filename)
Returns the elevation of the given JPEG file.
|
static java.lang.Double |
readElevation(com.drew.metadata.exif.GpsDirectory dirGps)
Returns the elevation of the given EXIF GPS directory.
|
static java.lang.String |
readHeadline(com.drew.metadata.iptc.IptcDirectory dirIptc)
Returns the headline of the given IPTC directory.
|
static java.util.List<java.lang.String> |
readKeywords(com.drew.metadata.iptc.IptcDirectory dirIptc)
Returns the keywords of the given IPTC directory.
|
static LatLon |
readLatLon(java.io.File filename)
Returns the geolocation of the given JPEG file.
|
static LatLon |
readLatLon(com.drew.metadata.exif.GpsDirectory dirGps)
Returns the geolocation of the given EXIF GPS directory.
|
static java.lang.String |
readObjectName(com.drew.metadata.iptc.IptcDirectory dirIptc)
Returns the object name of the given IPTC directory.
|
static java.lang.Integer |
readOrientation(java.io.File filename)
Returns the image orientation of the given JPEG file.
|
static java.lang.Double |
readSpeed(java.io.File filename)
Returns the speed of the given JPEG file.
|
static java.lang.Double |
readSpeed(com.drew.metadata.exif.GpsDirectory dirGps)
Returns the speed of the given EXIF GPS directory.
|
static java.util.Date |
readTime(java.io.File filename)
Returns the date/time from the given JPEG file.
|
static java.util.Date |
readTime(com.drew.metadata.Metadata metadata)
Returns the date/time from the given JPEG file.
|
private ExifReader()
public static java.util.Date readTime(java.io.File filename)
filename
- The JPEG file to readnull
if not foundpublic static java.util.Date readTime(com.drew.metadata.Metadata metadata)
metadata
- The EXIF metadatanull
if not foundpublic 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(com.drew.metadata.exif.GpsDirectory dirGps) throws com.drew.metadata.MetadataException
dirGps
- The EXIF GPS directorynull
if dirGps
is nullcom.drew.metadata.MetadataException
- if invalid metadata is givenpublic static java.lang.Double readDirection(java.io.File filename)
filename
- The JPEG file to readnull
if not foundpublic static java.lang.Double readDirection(com.drew.metadata.exif.GpsDirectory dirGps)
dirGps
- The EXIF GPS directorynull
if missing or if dirGps
is nullprivate static double readAxis(com.drew.metadata.exif.GpsDirectory dirGps, int gpsTag, int gpsTagRef, char cRef) throws com.drew.metadata.MetadataException
com.drew.metadata.MetadataException
public static java.lang.Double readSpeed(java.io.File filename)
filename
- The JPEG file to readnull
if not foundpublic static java.lang.Double readSpeed(com.drew.metadata.exif.GpsDirectory dirGps)
dirGps
- The EXIF GPS directorynull
if missing or if dirGps
is nullpublic static java.lang.Double readElevation(java.io.File filename)
filename
- The JPEG file to readnull
if not foundpublic static java.lang.Double readElevation(com.drew.metadata.exif.GpsDirectory dirGps)
dirGps
- The EXIF GPS directorynull
if missing or if dirGps
is nullpublic static java.lang.String readCaption(com.drew.metadata.iptc.IptcDirectory dirIptc)
dirIptc
- The IPTC directorynull
if missing or if dirIptc
is nullpublic static java.lang.String readHeadline(com.drew.metadata.iptc.IptcDirectory dirIptc)
dirIptc
- The IPTC directorynull
if missing or if dirIptc
is nullpublic static java.util.List<java.lang.String> readKeywords(com.drew.metadata.iptc.IptcDirectory dirIptc)
dirIptc
- The IPTC directorynull
if missing or if dirIptc
is nullpublic static java.lang.String readObjectName(com.drew.metadata.iptc.IptcDirectory dirIptc)
dirIptc
- The IPTC directorynull
if missing or if dirIptc
is nullpublic 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