|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object magoffin.matt.meta.support.AbstractMetadataResource magoffin.matt.meta.support.AbstractEnumMetadataResource<ImageMetadataType> magoffin.matt.meta.image.EXIFJpegMetadataResource
public class EXIFJpegMetadataResource
MetadataResource
implementation for JPEG+EXIF resources.
This implementation relies on Metadata Extractor, available from http://drewnoakes.com/code/exif/
Field Summary | |
---|---|
static java.lang.String |
EXIF_BASIC_DATE_FORMAT
A date format in the form yyyy:MM:dd hh:mm:ss . |
Fields inherited from class magoffin.matt.meta.support.AbstractMetadataResource |
---|
log |
Constructor Summary | |
---|---|
EXIFJpegMetadataResource(java.io.InputStream in)
Construct from an InputStream. |
|
EXIFJpegMetadataResource(com.drew.metadata.Metadata exif)
Construct from an existing EXIF Metadata instance. |
Method Summary | |
---|---|
protected java.lang.String |
extractAperture()
Extract the aperture (APEX value). |
protected java.lang.String |
extractCameraMake()
Extract the camera make. |
protected java.lang.String |
extractCameraModel()
Extract the cameral model. |
protected java.util.Date |
extractCreationDate()
Extract a creation date from the EXIF. |
protected java.lang.String |
extractExposureBias()
Extract the exposure bias, as an integer string. |
protected java.lang.String |
extractExposureTime()
Extract the exposure time as a String value. |
protected java.lang.String |
extractFlash()
Extract boolean FALSE if flash did not fire, TRUE otherwise. |
protected java.lang.String |
extractFocalLength()
Extract the focal length. |
protected java.lang.String |
extractFocalLength35mmEquiv()
Extract the focal length in terms of 35mm film. |
protected java.lang.String |
extractFstop()
Extract the aperture as an F-Stop value. |
protected java.lang.String |
extractGpsLatitude()
Extract the GPS latitude as a String value. |
protected java.lang.String |
extractGpsLongitude()
Extract the GPS longitude as a String value. |
protected java.lang.String |
extractOrientation()
Extract the orientation (as an integer string). |
protected java.lang.String |
extractShutterSpeed()
Extract the shutter speed as a String value. |
protected int |
getExifInt(int tagType)
Get an EXIF integer value. |
protected com.drew.lang.Rational |
getExifRational(int tagType)
Get a EXIF Rational value. |
protected java.lang.String |
getExifString(int tagType)
Get a EXIF String value. |
protected float |
getFocalLength35mmEquivFactor()
Get a multiplication factor to convert the EXIF focal length into a 35mm equivalent length, for cameras that work this way. |
protected int |
getMetaInt(java.lang.Class<? extends com.drew.metadata.Directory> dirClass,
int tagType)
Get an EXIF integer value from an arbitrary EXIF directory. |
protected com.drew.lang.Rational |
getMetaRational(java.lang.Class<? extends com.drew.metadata.Directory> dirClass,
int tagType)
Get a EXIF Rational value from an arbitrary EXIF directory. |
protected java.lang.String |
getMetaString(java.lang.Class<? extends com.drew.metadata.Directory> dirClass,
int tagType)
Get a metadata String value from an arbitrary EXIF directory. |
protected void |
parseExif()
Parse supported EXIF data from the Metadata instance
associated with this object. |
protected java.lang.String |
roundDecimal(double decimal,
int precision)
Round a decimal to a number of places. |
Methods inherited from class magoffin.matt.meta.support.AbstractEnumMetadataResource |
---|
addError, addValue, getValue, getValues, setValue, setValues |
Methods inherited from class magoffin.matt.meta.support.AbstractMetadataResource |
---|
addError, addValue, clearValues, getParsedKeys, getParseErrors, getValue, getValueList, getValues, setValue, setValues |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface magoffin.matt.meta.MetadataResource |
---|
getParsedKeys, getParseErrors, getValue, getValues |
Field Detail |
---|
public static final java.lang.String EXIF_BASIC_DATE_FORMAT
yyyy:MM:dd hh:mm:ss
.
Constructor Detail |
---|
public EXIFJpegMetadataResource(java.io.InputStream in)
in
- the JPEG input streampublic EXIFJpegMetadataResource(com.drew.metadata.Metadata exif)
Metadata
instance.
exif
- the EXIF metadataMethod Detail |
---|
protected void parseExif()
Metadata
instance
associated with this object.
Extending classes might want to override this behavior.
protected java.lang.String extractAperture()
protected java.lang.String extractFstop()
protected java.lang.String extractCameraMake()
protected java.lang.String extractCameraModel()
protected java.lang.String extractExposureBias()
protected java.lang.String extractFlash()
protected java.lang.String extractFocalLength()
protected java.lang.String extractFocalLength35mmEquiv()
protected java.lang.String extractOrientation()
protected java.util.Date extractCreationDate()
This method attempts to find the creation date for the image by taking the first value available from:
If a date is found, it is parsed using the date format
EXIF_BASIC_DATE_FORMAT
. If a parse
exception occurs, or no date is found, null is returned.
protected java.lang.String extractExposureTime()
This method attempts to format the exposure Rational in a sensible way.
protected java.lang.String extractShutterSpeed()
This method attempts to format the shutter speed Rational in a sensible way.
protected java.lang.String extractGpsLongitude()
This method combines the longitude reference with the longitude value.
protected java.lang.String extractGpsLatitude()
This method combines the latitude reference with the latitude value.
protected java.lang.String roundDecimal(double decimal, int precision)
decimal
- the number to roundprecision
- the maximum number of fraction digits
protected int getExifInt(int tagType)
tagType
- the EXIF tag to get an integer value for
-1
if not foundprotected com.drew.lang.Rational getExifRational(int tagType)
tagType
- the EXIF tag to get a Rational value for
protected java.lang.String getExifString(int tagType)
tagType
- the EXIF tag to get a String value for
protected int getMetaInt(java.lang.Class<? extends com.drew.metadata.Directory> dirClass, int tagType)
dirClass
- the class of the directory to extract fromtagType
- the EXIF tag to get an integer value for
-1
if not foundprotected com.drew.lang.Rational getMetaRational(java.lang.Class<? extends com.drew.metadata.Directory> dirClass, int tagType)
dirClass
- the class of the directory to extract fromtagType
- the EXIF tag to get a Rational value for
protected java.lang.String getMetaString(java.lang.Class<? extends com.drew.metadata.Directory> dirClass, int tagType)
dirClass
- the class of the directory to extract fromtagType
- the EXIF tag to get a String value for
protected float getFocalLength35mmEquivFactor()
This implementation returns 1
, i.e. no multiplication
factor. Extending classes can override this to provide a camera-specific
value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |