public class ExifAnalyzer extends Object
Modifier and Type | Method and Description |
---|---|
static ExifAnalyzer |
create(File file)
Creates a new
ExifAnalyzer for the given JPEG file. |
static ExifAnalyzer |
create(InputStream in)
Creates a new
ExifAnalyzer for the given JPEG input stream. |
String |
getAperture()
Gets the Aperture in F-Stops of the photo taken.
|
String |
getCameraModel()
Gets the Camera Model.
|
Date |
getDateTime(TimeZone tz)
Gets the date and time when the picture was taken according to the EXIF data.
|
ExifData |
getExifData()
Gets the
ExifData of the picture taken. |
String |
getExposureBias()
Gets the Exposure Bias of the photo taken.
|
String |
getFlash()
Reads the Flash Mode that was set on the camera for this photo.
|
String |
getFocalLength()
Gets the Focal Length of the photo taken.
|
String |
getFocusMode()
Reads the Focus Mode that was set on the camera for this photo.
|
Geolocation |
getGeolocation()
Gets the
Geolocation where the picture was taken. |
String |
getIso()
Gets the ISO value of the photo taken.
|
com.drew.metadata.Metadata |
getMetadata()
Gets the Metadata containing the EXIF information.
|
String |
getMeteringMode()
Reads the Metering Mode that was set on the camera for this photo.
|
String |
getProgram()
Reads the Program that was set on the camera for this photo.
|
String |
getShutter()
Gets the Shutter Speed of the photo taken.
|
String |
getWhiteBalance()
Reads the White Balance Mode that was set on the camera for this photo.
|
protected <T extends com.drew.metadata.Directory> |
readAngle(Class<T> directory,
int tag)
Converts an angle from a directory.
|
protected <T extends com.drew.metadata.Directory> |
readDate(Class<T> directory,
int tag,
TimeZone tz)
Fetches a
Date from a directory. |
protected <T extends com.drew.metadata.Directory> |
readInteger(Class<T> directory,
int tag)
Fetches an Integer from a directory.
|
protected <T extends com.drew.metadata.Directory> |
readRational(Class<T> directory,
int tag)
Fetches a Rational from a directory.
|
protected <T extends com.drew.metadata.Directory> |
readString(Class<T> directory,
int tag)
Fetches a String from a directory.
|
public static ExifAnalyzer create(File file) throws IOException
ExifAnalyzer
for the given JPEG file.file
- JPEG file to analyzeExifAnalyzer
or null
if it is no valid JPEG image.IOException
public static ExifAnalyzer create(InputStream in) throws IOException
ExifAnalyzer
for the given JPEG input stream.in
- JPEG input stream to analyzeExifAnalyzer
or null
if it is no valid JPEG image.IOException
public com.drew.metadata.Metadata getMetadata()
public ExifData getExifData()
ExifData
of the picture taken.ExifData
, never null
, but it could be empty.public Geolocation getGeolocation()
Geolocation
where the picture was taken.Geolocation
, never null
, but it could be empty.public Date getDateTime(TimeZone tz)
tz
- The camera's TimeZonenull
if the information could not be retrievedpublic String getCameraModel()
null
if the information could not be
retrievedpublic String getAperture()
null
if the information could not be retrievedpublic String getShutter()
null
if the information could not be
retrievedpublic String getIso()
null
if the information could not be retrievedpublic String getExposureBias()
null
if the information could not be
retrievedpublic String getFocalLength()
null
if the information could not be
retrievedpublic String getFlash()
null
if the information could not be
retrievedpublic String getWhiteBalance()
null
if the information could not be
retrievedpublic String getMeteringMode()
null
if the information could not be
retrievedpublic String getFocusMode()
null
if the information could not be
retrievedpublic String getProgram()
null
if the information could not be retrievedprotected <T extends com.drew.metadata.Directory> String readString(Class<T> directory, int tag)
directory
- Directory to read fromtag
- Tag to be readnull
if there was no such informationprotected <T extends com.drew.metadata.Directory> com.drew.lang.Rational readRational(Class<T> directory, int tag)
directory
- Directory to read fromtag
- Tag to be readnull
if there was no such informationprotected <T extends com.drew.metadata.Directory> Integer readInteger(Class<T> directory, int tag)
directory
- Directory to read fromtag
- Tag to be readnull
if there was no such informationprotected <T extends com.drew.metadata.Directory> Date readDate(Class<T> directory, int tag, TimeZone tz)
Date
from a directory.directory
- Directory to read fromtag
- Tag to be readtz
- TimeZone the camera is configured tonull
if there was no such informationprotected <T extends com.drew.metadata.Directory> BigDecimal readAngle(Class<T> directory, int tag)
directory
- Directory to read fromtag
- Tag to be readCopyright © 2009–2016. All rights reserved.