public class ExifInterface
extends java.lang.Object
ExifTag
限定符和类型 | 字段和说明 |
---|---|
static java.nio.ByteOrder |
DEFAULT_BYTE_ORDER |
static int |
DEFINITION_NULL |
static int |
IFD_NULL |
protected static java.util.HashSet<java.lang.Short> |
sBannedDefines
Tags with definitions that cannot be overridden (banned defines).
|
static int |
TAG_APERTURE_VALUE
Value is unsigned double
The actual aperture value of lens when the image was taken. |
static int |
TAG_ARTIST
Vallue is ascii String
This tag records the name of the camera owner, photographer or image creator. |
static int |
TAG_BITS_PER_SAMPLE |
static int |
TAG_BRIGHTNESS_VALUE
Value is signed double
Brightness of taken subject, unit is EV. |
static int |
TAG_CFA_PATTERN |
static int |
TAG_COLOR_SPACE
Value is int.
|
static int |
TAG_COMPONENTS_CONFIGURATION |
static int |
TAG_COMPRESSED_BITS_PER_PIXEL |
static int |
TAG_COMPRESSION
Value is unsigned int.
|
static int |
TAG_CONTRAST
Value is int.
|
static int |
TAG_COPYRIGHT
Values is ascii string
Shows copyright information |
static int |
TAG_CUSTOM_RENDERED |
static int |
TAG_DATE_TIME
Value is ascii string (20)
Date/Time of image was last modified. |
static int |
TAG_DATE_TIME_DIGITIZED
Value is ascii string (20)
Date/Time of image digitized. |
static int |
TAG_DATE_TIME_ORIGINAL
Value is ascii string (20)
Date/Time of original image taken. |
static int |
TAG_DEVICE_SETTING_DESCRIPTION |
static int |
TAG_DIGITAL_ZOOM_RATIO
Value is double.
|
static int |
TAG_EXIF_IFD |
static int |
TAG_EXIF_VERSION
ASCII string (4).
|
static int |
TAG_EXPOSURE_BIAS_VALUE
Value is signed double.
|
static int |
TAG_EXPOSURE_INDEX |
static int |
TAG_EXPOSURE_MODE
Value is int.
|
static int |
TAG_EXPOSURE_PROGRAM
Value is unsigned int.
|
static int |
TAG_EXPOSURE_TIME
Value is unsigned double
Exposure time (reciprocal of shutter speed). |
static int |
TAG_F_NUMBER
Value is unsigned double
The actual F-number(F-stop) of lens when the image was taken |
static int |
TAG_FILE_SOURCE |
static int |
TAG_FLASH
Value is unsigned integer
The 8 bits can be extracted and evaluated in this way: Bit 0 indicates the flash firing status bits 1 and 2 indicate the flash return status bits 3 and 4 indicate the flash mode bit 5 indicates whether the flash function is present and bit 6 indicates "red eye" mode bit 7 unused Resulting Flash tag values are: 0000.H = Flash did not fire 0001.H = Flash fired 0005.H = Strobe return light not detected 0007.H = Strobe return light detected 0009.H = Flash fired, compulsory flash mode 000D.H = Flash fired, compulsory flash mode, return light not detected 000F.H = Flash fired, compulsory flash mode, return light detected 0010.H = Flash did not fire, compulsory flash mode 0018.H = Flash did not fire, auto mode 0019.H = Flash fired, auto mode 001D.H = Flash fired, auto mode, return light not detected 001F.H = Flash fired, auto mode, return light detected 0020.H = No flash function 0041.H = Flash fired, red-eye reduction mode 0045.H = Flash fired, red-eye reduction mode, return light not detected 0047.H = Flash fired, red-eye reduction mode, return light detected 0049.H = Flash fired, compulsory flash mode, red-eye reduction mode 004D.H = Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected 004F.H = Flash fired, compulsory flash mode, red-eye reduction mode, return light detected 0059.H = Flash fired, auto mode, red-eye reduction mode 005D.H = Flash fired, auto mode, return light not detected, red-eye reduction mode 005F.H = Flash fired, auto mode, return light detected, red-eye reduction mode Other = reserved |
static int |
TAG_FLASH_ENERGY |
static int |
TAG_FLASHPIX_VERSION |
static int |
TAG_FOCAL_LENGTH
Value is unsigned double
Focal length of lens used to take image. |
static int |
TAG_FOCAL_LENGTH_IN_35_MM_FILE
Value is unsigned int.
|
static int |
TAG_FOCAL_PLANE_RESOLUTION_UNIT
Value is unsigned int.
|
static int |
TAG_FOCAL_PLANE_X_RESOLUTION
Value is unsigned double.
|
static int |
TAG_FOCAL_PLANE_Y_RESOLUTION |
static int |
TAG_GAIN_CONTROL
Value is int.
|
static int |
TAG_GPS_ALTITUDE
Value is string.
|
static int |
TAG_GPS_ALTITUDE_REF
Value is byte
Indicates the altitude used as the reference altitude. |
static int |
TAG_GPS_AREA_INFORMATION |
static int |
TAG_GPS_DATE_STAMP |
static int |
TAG_GPS_DEST_BEARING |
static int |
TAG_GPS_DEST_BEARING_REF |
static int |
TAG_GPS_DEST_DISTANCE |
static int |
TAG_GPS_DEST_DISTANCE_REF |
static int |
TAG_GPS_DEST_LATITUDE |
static int |
TAG_GPS_DEST_LATITUDE_REF |
static int |
TAG_GPS_DEST_LONGITUDE |
static int |
TAG_GPS_DEST_LONGITUDE_REF |
static int |
TAG_GPS_DIFFERENTIAL |
static int |
TAG_GPS_DOP |
static int |
TAG_GPS_IFD |
static int |
TAG_GPS_IMG_DIRECTION |
static int |
TAG_GPS_IMG_DIRECTION_REF |
static int |
TAG_GPS_LATITUDE
Value is string.
|
static int |
TAG_GPS_LATITUDE_REF
Value is string(1)
Indicates whether the latitude is north or south latitude. |
static int |
TAG_GPS_LONGITUDE
Value is string.
|
static int |
TAG_GPS_LONGITUDE_REF
Value is string(1)
Indicates whether the longitude is east or west longitude. |
static int |
TAG_GPS_MAP_DATUM |
static int |
TAG_GPS_MEASURE_MODE |
static int |
TAG_GPS_PROCESSING_METHOD |
static int |
TAG_GPS_SATTELLITES |
static int |
TAG_GPS_SPEED
Value is string.
|
static int |
TAG_GPS_SPEED_REF
Value is string(1).
|
static int |
TAG_GPS_STATUS |
static int |
TAG_GPS_TIME_STAMP |
static int |
TAG_GPS_TRACK |
static int |
TAG_GPS_TRACK_REF |
static int |
TAG_GPS_VERSION_ID |
static int |
TAG_IMAGE_DESCRIPTION |
static int |
TAG_IMAGE_LENGTH |
static int |
TAG_IMAGE_UNIQUE_ID
|
static int |
TAG_IMAGE_WIDTH
Tag constants for Jeita EXIF 2.2
|
static int |
TAG_INTEROP_VERSION |
static int |
TAG_INTEROPERABILITY_IFD |
static int |
TAG_INTEROPERABILITY_INDEX |
static int |
TAG_ISO_SPEED_RATINGS
Value is unsigned int.
|
static int |
TAG_JPEG_INTERCHANGE_FORMAT |
static int |
TAG_JPEG_INTERCHANGE_FORMAT_LENGTH |
static int |
TAG_LENS_MAKE
Lens maker
ExifTag.TYPE_ASCII |
static int |
TAG_LENS_MODEL
Lens model name and number
ExifTag.TYPE_ASCII |
static int |
TAG_LENS_SPECS
Lens Specifications.
|
static int |
TAG_LIGHT_SOURCE
Value is unsigned int.
|
static int |
TAG_MAKE
Value is ascii string
The manufacturer of the recording equipment. |
static int |
TAG_MAKER_NOTE |
static int |
TAG_MAX_APERTURE_VALUE
Value is unsigned double.
|
static int |
TAG_METERING_MODE
Value is unsigned int.
|
static int |
TAG_MODEL
Value is ascii string
The model name or model number of the equipment. |
static int |
TAG_NULL |
static int |
TAG_OECF |
static int |
TAG_ORIENTATION
Value is int
The orientation of the camera relative to the scene, when the image was captured. |
static int |
TAG_PHOTOMETRIC_INTERPRETATION |
static int |
TAG_PIXEL_X_DIMENSION
Value is unsigned int.
|
static int |
TAG_PIXEL_Y_DIMENSION |
static int |
TAG_PLANAR_CONFIGURATION |
static int |
TAG_PRIMARY_CHROMATICITIES |
static int |
TAG_REFERENCE_BLACK_WHITE |
static int |
TAG_RELATED_SOUND_FILE |
static int |
TAG_RESOLUTION_UNIT
Value is unsigned int.
|
static int |
TAG_ROWS_PER_STRIP |
static int |
TAG_SAMPLES_PER_PIXEL |
static int |
TAG_SATURATION
Value is int.
|
static int |
TAG_SCENE_CAPTURE_TYPE
Value is int.
|
static int |
TAG_SCENE_TYPE |
static int |
TAG_SENSING_METHOD
Value is unsigned int.
|
static int |
TAG_SENSITIVITY_TYPE
The SensitivityType tag indicates which one of the parameters of ISO12232 is the
PhotographicSensitivity tag.
|
static int |
TAG_SHARPNESS
Value is int.
|
static int |
TAG_SHUTTER_SPEED_VALUE
Value is signed double.
|
static int |
TAG_SOFTWARE
Value is ascii string
Shows firmware(internal software of digicam) version number. |
static int |
TAG_SPATIAL_FREQUENCY_RESPONSE |
static int |
TAG_SPECTRAL_SENSITIVITY |
static int |
TAG_STRIP_BYTE_COUNTS |
static int |
TAG_STRIP_OFFSETS |
static int |
TAG_SUB_SEC_TIME |
static int |
TAG_SUB_SEC_TIME_DIGITIZED |
static int |
TAG_SUB_SEC_TIME_ORIGINAL |
static int |
TAG_SUBJECT_AREA |
static int |
TAG_SUBJECT_DISTANCE
Value if signed double.
|
static int |
TAG_SUBJECT_DISTANCE_RANGE
Value is int.
|
static int |
TAG_SUBJECT_LOCATION |
static int |
TAG_TRANSFER_FUNCTION |
static int |
TAG_USER_COMMENT |
static int |
TAG_WHITE_BALANCE |
static int |
TAG_WHITE_POINT |
static int |
TAG_X_RESOLUTION
Value is unsigned double.
|
static int |
TAG_Y_CB_CR_COEFFICIENTS |
static int |
TAG_Y_CB_CR_POSITIONING |
static int |
TAG_Y_CB_CR_SUB_SAMPLING |
static int |
TAG_Y_RESOLUTION |
构造器和说明 |
---|
ExifInterface() |
限定符和类型 | 方法和说明 |
---|---|
boolean |
addDateTimeStampTag(int tagId,
long timestamp,
java.util.TimeZone timezone)
Creates, formats, and sets the DateTimeStamp tag for one of:
TAG_DATE_TIME , TAG_DATE_TIME_DIGITIZED ,
TAG_DATE_TIME_ORIGINAL . |
boolean |
addGpsDateTimeStampTag(long timestamp)
Creates and sets the GPS timestamp tag.
|
boolean |
addGpsTags(double latitude,
double longitude)
Creates and sets all to the GPS tags for a give latitude and longitude.
|
ExifTag |
buildTag(int tagId,
int ifdId,
java.lang.Object val)
Creates a tag for a defined tag constant in a given IFD if that IFD is
allowed for the tag.
|
ExifTag |
buildTag(int tagId,
java.lang.Object val)
Creates a tag for a defined tag constant in the tag's default IFD.
|
protected ExifTag |
buildUninitializedTag(int tagId) |
void |
clearExif()
Clears this ExifInterface object's existing exif tags.
|
protected static void |
closeSilently(java.io.Closeable c) |
static double |
convertLatOrLongToDouble(Rational[] coordinate,
java.lang.String reference)
Gets the double representation of the GPS latitude or longitude
coordinate.
|
static int |
defineTag(int ifdId,
short tagId)
Returns the constant representing a tag with a given TID and default IFD.
|
void |
deleteTag(int tagId)
Removes the ExifTag for a tag constant from that tag's default IFD.
|
void |
deleteTag(int tagId,
int ifdId)
Removes the ExifTag for a tag constant from the given IFD.
|
int |
getActualTagCount(int tagId,
int ifdId)
Gets the number of elements for an ExifTag in a given IFD.
|
protected static int |
getAllowedIfdFlagsFromInfo(int info) |
protected static int[] |
getAllowedIfdsFromInfo(int info) |
java.util.List<ExifTag> |
getAllTags()
Get the exif tags in this ExifInterface object or null if none exist.
|
double |
getAltitude(double defaultValue)
Return the altitude in meters.
|
double |
getApertureSize()
Return the aperture size, if present, 0 if missing
|
protected static int |
getComponentCountFromInfo(int info) |
static java.util.Date |
getDateTime(java.lang.String dateTimeString,
java.util.TimeZone timeZone)
Given an exif date time, like
TAG_DATE_TIME or TAG_DATE_TIME_DIGITIZED
returns a java Date object |
int |
getDefinedTagCount(int tagId)
Gets the defined number of elements for a tag.
|
int |
getDefinedTagDefaultIfd(int tagId)
Gets the default IFD for a tag.
|
short |
getDefinedTagType(int tagId)
Gets the defined type for a tag.
|
protected static int |
getFlagsFromAllowedIfds(int[] allowedIfds) |
int[] |
getImageSize()
Returns the Image size as decoded from the SOF marker
|
short |
getJpegProcess()
this gives information about the process used to create the JPEG file.
|
java.lang.String |
getLatitude()
Returns a formatted String with the latitude representation:
39° 8' 16.8" N |
double[] |
getLatLongAsDoubles()
Gets the GPS latitude and longitude as a pair of doubles from this
ExifInterface object's tags, or null if the necessary tags do not exist.
|
java.lang.String |
getLensModelDescription()
Returns the lens model as string if any of the tags
TAG_LENS_MODEL
or TAG_LENS_SPECS are found |
java.lang.String |
getLongitude()
Returns a formatted String with the longitude representation:
77° 37' 51.6" W |
static short |
getOrientationValueForRotation(int degrees)
Returns the Orientation ExifTag value for a given number of degrees.
|
int |
getQualityGuess()
Returns the JPEG quality used to generate the image
or 0 if not found
|
double |
getResolutionUnit(int resolution)
Given the value from
TAG_FOCAL_PLANE_RESOLUTION_UNIT or TAG_RESOLUTION_UNIT
this method will return the corresponding value in millimeters |
static int |
getRotationForOrientationValue(short orientation)
Returns the rotation degrees corresponding to an ExifTag Orientation
value.
|
ExifTag |
getTag(int tagId)
Returns the ExifTag in that tag's default IFD for a defined tag constant
or null if none exists.
|
ExifTag |
getTag(int tagId,
int ifdId)
Gets an ExifTag for an IFD other than the tag's default.
|
java.lang.Byte |
getTagByteValue(int tagId) |
java.lang.Byte |
getTagByteValue(int tagId,
int ifdId) |
byte[] |
getTagByteValues(int tagId) |
byte[] |
getTagByteValues(int tagId,
int ifdId) |
protected int |
getTagDefinition(short tagId,
int defaultIfd) |
protected int |
getTagDefinitionForTag(ExifTag tag) |
protected int |
getTagDefinitionForTag(short tagId,
short type,
int count,
int ifd) |
protected int[] |
getTagDefinitionsForTagId(short tagId) |
protected android.util.SparseIntArray |
getTagInfo() |
java.lang.Integer |
getTagIntValue(int tagId) |
java.lang.Integer |
getTagIntValue(int tagId,
int ifdId) |
int[] |
getTagIntValues(int tagId) |
int[] |
getTagIntValues(int tagId,
int ifdId) |
java.lang.Long |
getTagLongValue(int tagId) |
java.lang.Long |
getTagLongValue(int tagId,
int ifdId) |
long[] |
getTagLongValues(int tagId) |
long[] |
getTagLongValues(int tagId,
int ifdId) |
Rational |
getTagRationalValue(int tagId) |
Rational |
getTagRationalValue(int tagId,
int ifdId) |
Rational[] |
getTagRationalValues(int tagId) |
Rational[] |
getTagRationalValues(int tagId,
int ifdId) |
java.util.List<ExifTag> |
getTagsForIfdId(int ifdId)
Returns a list of ExifTags that share an IFD (which can be obtained by
calling
getTrueIfd(int) on a defined tag constant) or null if none
exist. |
java.util.List<ExifTag> |
getTagsForTagId(short tagId)
Returns a list of ExifTags that share a TID (which can be obtained by
calling
getTrueTagKey(int) on a defined tag constant) or null if none
exist. |
java.lang.String |
getTagStringValue(int tagId) |
java.lang.String |
getTagStringValue(int tagId,
int ifdId) |
java.lang.Object |
getTagValue(int tagId)
Returns the value of the ExifTag in that tag's default IFD for a defined
tag constant or null if none exists or the value could not be cast into
the return type.
|
java.lang.Object |
getTagValue(int tagId,
int ifdId)
Gets a tag value for an IFD other than the tag's default.
|
byte[] |
getThumbnail()
Returns the thumbnail if it is jpeg compressed, or null if none exists.
|
android.graphics.Bitmap |
getThumbnailBitmap()
Returns the thumbnail from IFD1 as a bitmap, or null if none exists.
|
byte[] |
getThumbnailBytes()
Returns the thumbnail from IFD1 as a byte array, or null if none exists.
|
static int |
getTrueIfd(int tag)
Returns the default IFD for a tag constant.
|
static short |
getTrueTagKey(int tag)
Returns the TID for a tag constant.
|
protected static short |
getTypeFromInfo(int info) |
java.lang.String |
getUserComment()
Decodes the user comment tag into string as specified in the EXIF
standard.
|
boolean |
hasThumbnail()
Check if thumbnail exists.
|
protected static boolean |
isIfdAllowed(int info,
int ifd) |
protected static boolean |
isOffsetTag(short tag)
Returns true if tag TID is one of the following:
TAG_EXIF_IFD ,
TAG_GPS_IFD , TAG_JPEG_INTERCHANGE_FORMAT ,
TAG_STRIP_OFFSETS , TAG_INTEROPERABILITY_IFD
Note: defining tags with these TID's is disallowed. |
boolean |
isTagCountDefined(int tagId)
Checks whether a tag has a defined number of elements.
|
boolean |
isThumbnailCompressed()
Check if thumbnail is compressed.
|
void |
readExif(byte[] jpeg,
int options)
Reads the exif tags from a byte array, clearing this ExifInterface
object's existing exif tags.
|
void |
readExif(java.io.InputStream inStream,
int options)
Reads the exif tags from an InputStream, clearing this ExifInterface
object's existing exif tags.
|
void |
readExif(java.lang.String inFileName,
int options)
Reads the exif tags from a file, clearing this ExifInterface object's
existing exif tags.
|
void |
removeCompressedThumbnail()
Clears the compressed thumbnail if it exists.
|
void |
removeTagDefinition(int tagId)
Removes a tag definition for given defined tag constant.
|
void |
resetTagDefinitions()
Resets tag definitions to the default ones.
|
boolean |
setCompressedThumbnail(android.graphics.Bitmap thumb)
Sets the thumbnail to be a jpeg compressed bitmap.
|
boolean |
setCompressedThumbnail(byte[] thumb)
Sets the thumbnail to be a jpeg compressed image.
|
void |
setExif(java.util.Collection<ExifTag> tags)
Sets the exif tags, clearing this ExifInterface object's existing exif
tags.
|
ExifTag |
setTag(ExifTag tag)
Puts an ExifTag into this ExifInterface object's tags, removing a
previous ExifTag with the same TID and IFD.
|
int |
setTagDefinition(short tagId,
int defaultIfd,
short tagType,
short defaultComponentCount,
int[] allowedIfds)
Creates a new tag definition in this ExifInterface object for a given TID
and default IFD.
|
void |
setTags(java.util.Collection<ExifTag> tags)
Puts a collection of ExifTags into this ExifInterface objects's tags.
|
boolean |
setTagValue(int tagId,
int ifdId,
java.lang.Object val)
Sets the value of an ExifTag if it exists in the given IFD.
|
boolean |
setTagValue(int tagId,
java.lang.Object val)
Sets the value of an ExifTag if it exists it's default IFD.
|
static byte[] |
toBitArray(short value) |
void |
writeExif(android.graphics.Bitmap input,
java.lang.String dstFilename,
int quality) |
void |
writeExif(java.io.InputStream input,
java.lang.String dstFilename) |
void |
writeExif(java.lang.String dstFilename) |
boolean |
writeExif(java.lang.String srcFilename,
java.lang.String dstFilename) |
public static final int TAG_NULL
public static final int IFD_NULL
public static final int DEFINITION_NULL
public static final int TAG_IMAGE_WIDTH
public static final int TAG_IMAGE_LENGTH
public static final int TAG_BITS_PER_SAMPLE
public static final int TAG_COMPRESSION
public static final int TAG_PHOTOMETRIC_INTERPRETATION
public static final int TAG_IMAGE_DESCRIPTION
public static final int TAG_MAKE
public static final int TAG_MODEL
public static final int TAG_STRIP_OFFSETS
public static final int TAG_ORIENTATION
public static final int TAG_SAMPLES_PER_PIXEL
public static final int TAG_ROWS_PER_STRIP
public static final int TAG_STRIP_BYTE_COUNTS
public static final int TAG_INTEROP_VERSION
public static final int TAG_X_RESOLUTION
public static final int TAG_Y_RESOLUTION
TAG_X_RESOLUTION
public static final int TAG_PLANAR_CONFIGURATION
public static final int TAG_RESOLUTION_UNIT
public static final int TAG_TRANSFER_FUNCTION
public static final int TAG_SOFTWARE
public static final int TAG_DATE_TIME
public static final int TAG_ARTIST
public static final int TAG_WHITE_POINT
public static final int TAG_PRIMARY_CHROMATICITIES
public static final int TAG_Y_CB_CR_COEFFICIENTS
public static final int TAG_Y_CB_CR_SUB_SAMPLING
public static final int TAG_Y_CB_CR_POSITIONING
public static final int TAG_REFERENCE_BLACK_WHITE
public static final int TAG_COPYRIGHT
public static final int TAG_EXIF_IFD
public static final int TAG_GPS_IFD
public static final int TAG_JPEG_INTERCHANGE_FORMAT
public static final int TAG_JPEG_INTERCHANGE_FORMAT_LENGTH
public static final int TAG_EXPOSURE_TIME
public static final int TAG_F_NUMBER
TAG_APERTURE_VALUE
public static final int TAG_EXPOSURE_PROGRAM
public static final int TAG_SPECTRAL_SENSITIVITY
public static final int TAG_ISO_SPEED_RATINGS
public static final int TAG_OECF
public static final int TAG_EXIF_VERSION
public static final int TAG_DATE_TIME_ORIGINAL
public static final int TAG_DATE_TIME_DIGITIZED
public static final int TAG_COMPONENTS_CONFIGURATION
public static final int TAG_COMPRESSED_BITS_PER_PIXEL
public static final int TAG_SHUTTER_SPEED_VALUE
public static final int TAG_APERTURE_VALUE
FNumber = Math.exp( ApertureValue * Math.log( 2 ) * 0.5 );
TAG_F_NUMBER
public static final int TAG_BRIGHTNESS_VALUE
public static final int TAG_EXPOSURE_BIAS_VALUE
public static final int TAG_MAX_APERTURE_VALUE
FNumber = Math.exp( MaxApertureValue * Math.log( 2 ) * 0.5 )
public static final int TAG_SUBJECT_DISTANCE
public static final int TAG_METERING_MODE
public static final int TAG_LIGHT_SOURCE
public static final int TAG_FLASH
public static final int TAG_FOCAL_LENGTH
public static final int TAG_SUBJECT_AREA
public static final int TAG_MAKER_NOTE
public static final int TAG_USER_COMMENT
public static final int TAG_SUB_SEC_TIME
public static final int TAG_SUB_SEC_TIME_ORIGINAL
public static final int TAG_SUB_SEC_TIME_DIGITIZED
public static final int TAG_FLASHPIX_VERSION
public static final int TAG_COLOR_SPACE
public static final int TAG_PIXEL_X_DIMENSION
public static final int TAG_PIXEL_Y_DIMENSION
TAG_PIXEL_X_DIMENSION
public static final int TAG_RELATED_SOUND_FILE
public static final int TAG_INTEROPERABILITY_IFD
public static final int TAG_FLASH_ENERGY
public static final int TAG_SPATIAL_FREQUENCY_RESPONSE
public static final int TAG_FOCAL_PLANE_X_RESOLUTION
public static final int TAG_FOCAL_PLANE_Y_RESOLUTION
public static final int TAG_FOCAL_PLANE_RESOLUTION_UNIT
CCDWidth = ( PixelXDimension * FocalPlaneResolutionUnit / FocalPlaneXResolution )
public static final int TAG_SUBJECT_LOCATION
public static final int TAG_EXPOSURE_INDEX
public static final int TAG_SENSING_METHOD
public static final int TAG_FILE_SOURCE
public static final int TAG_SCENE_TYPE
public static final int TAG_CFA_PATTERN
public static final int TAG_CUSTOM_RENDERED
public static final int TAG_EXPOSURE_MODE
public static final int TAG_WHITE_BALANCE
public static final int TAG_DIGITAL_ZOOM_RATIO
public static final int TAG_FOCAL_LENGTH_IN_35_MM_FILE
CCDWidth = ( PixelXDimension * FocalplaneUnits / FocalplaneXRes ); FocalLengthIn35mmFilm = ( FocalLength / CCDWidth * 36 + 0.5 );
public static final int TAG_SCENE_CAPTURE_TYPE
public static final int TAG_GAIN_CONTROL
public static final int TAG_CONTRAST
public static final int TAG_SATURATION
public static final int TAG_SHARPNESS
public static final int TAG_DEVICE_SETTING_DESCRIPTION
public static final int TAG_SUBJECT_DISTANCE_RANGE
public static final int TAG_IMAGE_UNIQUE_ID
public static final int TAG_LENS_SPECS
ExifTag.TYPE_RATIONAL
it.sephiroth.android.library.exif2.ExifUtil#processLensSpecifications(Rational[])
public static final int TAG_LENS_MAKE
ExifTag.TYPE_ASCII
public static final int TAG_LENS_MODEL
ExifTag.TYPE_ASCII
public static final int TAG_SENSITIVITY_TYPE
ExifTag.TYPE_UNSIGNED_SHORT
it.sephiroth.android.library.exif2.ExifInterface.SensitivityType
public static final int TAG_GPS_VERSION_ID
public static final int TAG_GPS_LATITUDE_REF
public static final int TAG_GPS_LATITUDE
public static final int TAG_GPS_LONGITUDE_REF
public static final int TAG_GPS_LONGITUDE
public static final int TAG_GPS_ALTITUDE_REF
public static final int TAG_GPS_ALTITUDE
public static final int TAG_GPS_TIME_STAMP
public static final int TAG_GPS_SATTELLITES
public static final int TAG_GPS_STATUS
public static final int TAG_GPS_MEASURE_MODE
public static final int TAG_GPS_DOP
public static final int TAG_GPS_SPEED_REF
public static final int TAG_GPS_SPEED
public static final int TAG_GPS_TRACK_REF
public static final int TAG_GPS_TRACK
public static final int TAG_GPS_IMG_DIRECTION_REF
public static final int TAG_GPS_IMG_DIRECTION
public static final int TAG_GPS_MAP_DATUM
public static final int TAG_GPS_DEST_LATITUDE_REF
public static final int TAG_GPS_DEST_LATITUDE
public static final int TAG_GPS_DEST_LONGITUDE_REF
public static final int TAG_GPS_DEST_LONGITUDE
public static final int TAG_GPS_DEST_BEARING_REF
public static final int TAG_GPS_DEST_BEARING
public static final int TAG_GPS_DEST_DISTANCE_REF
public static final int TAG_GPS_DEST_DISTANCE
public static final int TAG_GPS_PROCESSING_METHOD
public static final int TAG_GPS_AREA_INFORMATION
public static final int TAG_GPS_DATE_STAMP
public static final int TAG_GPS_DIFFERENTIAL
public static final int TAG_INTEROPERABILITY_INDEX
public static final java.nio.ByteOrder DEFAULT_BYTE_ORDER
protected static java.util.HashSet<java.lang.Short> sBannedDefines
protected static boolean isOffsetTag(short tag)
TAG_EXIF_IFD
,
TAG_GPS_IFD
, TAG_JPEG_INTERCHANGE_FORMAT
,
TAG_STRIP_OFFSETS
, TAG_INTEROPERABILITY_IFD
Note: defining tags with these TID's is disallowed.tag
- a tag's TID (can be obtained from a defined tag constant with
getTrueTagKey(int)
).public static short getOrientationValueForRotation(int degrees)
degrees
- the amount an image is rotated in degrees.public static int getRotationForOrientationValue(short orientation)
orientation
- the ExifTag Orientation value.public double getResolutionUnit(int resolution)
TAG_FOCAL_PLANE_RESOLUTION_UNIT
or TAG_RESOLUTION_UNIT
this method will return the corresponding value in millimetersresolution
- TAG_FOCAL_PLANE_RESOLUTION_UNIT
or TAG_RESOLUTION_UNIT
public static double convertLatOrLongToDouble(Rational[] coordinate, java.lang.String reference)
coordinate
- an array of 3 Rationals representing the degrees,
minutes, and seconds of the GPS location as defined in the
exif specification.reference
- a GPS reference reperesented by a String containing "N",
"S", "E", or "W".protected static int[] getAllowedIfdsFromInfo(int info)
public void readExif(java.lang.String inFileName, int options) throws java.io.IOException
inFileName
- a string representing the filepath to jpeg file.options
- bit flag which defines which type of tags to process, see it.sephiroth.android.library.exif2.ExifInterface.Options
java.io.IOException
readExif(java.io.InputStream, int)
public void readExif(java.io.InputStream inStream, int options) throws java.io.IOException
ExifInterface exif = new ExifInterface(); exif.readExif( stream, Options.OPTION_IFD_0 | Options.OPTION_IFD_1 | Options.OPTION_IFD_EXIF ); ... // to request all the options use the OPTION_ALL bit mask exif.readExif( stream, Options.OPTION_ALL );
inStream
- an InputStream containing a jpeg compressed image.options
- bit flag which defines which type of tags to process, see it.sephiroth.android.library.exif2.ExifInterface.Options
java.io.IOException
protected static void closeSilently(java.io.Closeable c)
public void setExif(java.util.Collection<ExifTag> tags)
tags
- a collection of exif tags to set.public void clearExif()
public void setTags(java.util.Collection<ExifTag> tags)
tags
- a Collection of ExifTags.setTag(org.lasque.tusdk.core.exif.ExifTag)
public ExifTag setTag(ExifTag tag)
buildTag(int, java.lang.Object)
.tag
- an ExifTag to put into this ExifInterface's tags.public void writeExif(java.lang.String dstFilename) throws java.io.IOException
java.io.IOException
public boolean writeExif(java.lang.String srcFilename, java.lang.String dstFilename) throws java.io.IOException
java.io.IOException
public void writeExif(java.io.InputStream input, java.lang.String dstFilename) throws java.io.IOException
java.io.IOException
public void writeExif(android.graphics.Bitmap input, java.lang.String dstFilename, int quality) throws java.io.IOException
java.io.IOException
public java.util.List<ExifTag> getAllTags()
ExifTag
s.public void readExif(byte[] jpeg, int options) throws java.io.IOException
jpeg
- a byte array containing a jpeg compressed image.options
- bit flag which defines which type of tags to process, see it.sephiroth.android.library.exif2.ExifInterface.Options
java.io.IOException
readExif(java.io.InputStream, int)
public java.util.List<ExifTag> getTagsForTagId(short tagId)
getTrueTagKey(int)
on a defined tag constant) or null if none
exist.tagId
- a TID as defined in the exif standard (or with
defineTag(int, short)
).ExifTag
s.public java.util.List<ExifTag> getTagsForIfdId(int ifdId)
getTrueIfd(int)
on a defined tag constant) or null if none
exist.ifdId
- an IFD as defined in the exif standard (or with
defineTag(int, short)
).ExifTag
s.public ExifTag getTag(int tagId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.ExifTag
or null if none exists.public int getDefinedTagDefaultIfd(int tagId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.IFD_NULL
if no
definition exists.public ExifTag getTag(int tagId, int ifdId)
getTag(int)
protected android.util.SparseIntArray getTagInfo()
public static int getTrueIfd(int tag)
public static short getTrueTagKey(int tag)
protected static int getFlagsFromAllowedIfds(int[] allowedIfds)
public java.lang.Object getTagValue(int tagId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.public java.lang.Object getTagValue(int tagId, int ifdId)
getTagValue(int)
public java.lang.String getTagStringValue(int tagId, int ifdId)
getTagValue(int)
public java.lang.String getTagStringValue(int tagId)
getTagValue(int)
public java.lang.Long getTagLongValue(int tagId)
getTagValue(int)
public java.lang.Long getTagLongValue(int tagId, int ifdId)
getTagValue(int)
public long[] getTagLongValues(int tagId, int ifdId)
getTagValue(int)
public java.lang.Integer getTagIntValue(int tagId)
getTagValue(int)
public java.lang.Integer getTagIntValue(int tagId, int ifdId)
getTagValue(int)
public int[] getTagIntValues(int tagId, int ifdId)
getTagValue(int)
public java.lang.Byte getTagByteValue(int tagId)
getTagValue(int)
public java.lang.Byte getTagByteValue(int tagId, int ifdId)
getTagValue(int)
public byte[] getTagByteValues(int tagId, int ifdId)
getTagValue(int)
public Rational getTagRationalValue(int tagId)
getTagValue(int)
public Rational getTagRationalValue(int tagId, int ifdId)
getTagValue(int)
public Rational[] getTagRationalValues(int tagId, int ifdId)
getTagValue(int)
public long[] getTagLongValues(int tagId)
getTagValue(int)
public int[] getTagIntValues(int tagId)
getTagValue(int)
public byte[] getTagByteValues(int tagId)
getTagValue(int)
public Rational[] getTagRationalValues(int tagId)
getTagValue(int)
public boolean isTagCountDefined(int tagId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.protected static int getComponentCountFromInfo(int info)
public int getDefinedTagCount(int tagId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.ExifTag.SIZE_UNDEFINED
if the
tag or the number of elements is not defined.public int getActualTagCount(int tagId, int ifdId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.ifdId
- the IFD containing the ExifTag to check.public short getDefinedTagType(int tagId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.ExifTag.getDataType()
protected static short getTypeFromInfo(int info)
protected ExifTag buildUninitializedTag(int tagId)
public boolean setTagValue(int tagId, java.lang.Object val)
tagId
- a tag constant, e.g. TAG_IMAGE_WIDTH
.val
- the value to set.public boolean setTagValue(int tagId, int ifdId, java.lang.Object val)
tagId
- a tag constant, e.g. TAG_IMAGE_WIDTH
.ifdId
- the IFD that the ExifTag is in.val
- the value to set.setTagValue(int, java.lang.Object)
public void deleteTag(int tagId)
tagId
- a tag constant, e.g. TAG_IMAGE_WIDTH
.public void deleteTag(int tagId, int ifdId)
tagId
- a tag constant, e.g. TAG_IMAGE_WIDTH
.ifdId
- the IFD of the ExifTag to remove.public int setTagDefinition(short tagId, int defaultIfd, short tagType, short defaultComponentCount, int[] allowedIfds)
tagId
- the TID for the tag.defaultIfd
- the default IFD for the tag.tagType
- the type of the tag (see ExifTag.getDataType()
).defaultComponentCount
- the number of elements of this tag's type in
the tags value.allowedIfds
- the IFD's this tag is allowed to be put in.TAG_IMAGE_WIDTH
) or
TAG_NULL
if the definition could not be made.protected int getTagDefinition(short tagId, int defaultIfd)
public static int defineTag(int ifdId, short tagId)
protected int[] getTagDefinitionsForTagId(short tagId)
protected int getTagDefinitionForTag(ExifTag tag)
protected int getTagDefinitionForTag(short tagId, short type, int count, int ifd)
public void removeTagDefinition(int tagId)
tagId
- a defined tag constant, e.g. TAG_IMAGE_WIDTH
.public void resetTagDefinitions()
public android.graphics.Bitmap getThumbnailBitmap()
public byte[] getThumbnailBytes()
public byte[] getThumbnail()
public int getQualityGuess()
public short getJpegProcess()
public int[] getImageSize()
public boolean isThumbnailCompressed()
public boolean hasThumbnail()
public boolean setCompressedThumbnail(android.graphics.Bitmap thumb)
thumb
- a bitmap to compress to a jpeg thumbnail.public boolean setCompressedThumbnail(byte[] thumb)
thumb
- a byte array containing a jpeg compressed image.public void removeCompressedThumbnail()
public java.lang.String getUserComment()
public double getAltitude(double defaultValue)
defaultValue
- the value to return if the tag is not available.public double[] getLatLongAsDoubles()
convertLatOrLongToDouble(org.lasque.tusdk.core.exif.Rational[], java.lang.String)
public java.lang.String getLatitude()
public java.lang.String getLongitude()
public static java.util.Date getDateTime(java.lang.String dateTimeString, java.util.TimeZone timeZone)
TAG_DATE_TIME
or TAG_DATE_TIME_DIGITIZED
returns a java Date objectdateTimeString
- one of the value of TAG_DATE_TIME
or TAG_DATE_TIME_DIGITIZED
timeZone
- the target timezonepublic boolean addDateTimeStampTag(int tagId, long timestamp, java.util.TimeZone timezone)
TAG_DATE_TIME
, TAG_DATE_TIME_DIGITIZED
,
TAG_DATE_TIME_ORIGINAL
.tagId
- one of the DateTimeStamp tags.timestamp
- a timestamp to format.timezone
- a TimeZone object.public ExifTag buildTag(int tagId, java.lang.Object val)
tagId
- a tag constant, e.g. TAG_IMAGE_WIDTH
.val
- the tag's value.public ExifTag buildTag(int tagId, int ifdId, java.lang.Object val)
ExifTag.setValue(int[])
for this tag's datatype would fail.tagId
- a tag constant, e.g. TAG_IMAGE_WIDTH
.ifdId
- the IFD that the tag should be in.val
- the value of the tag to set.buildTag(int, java.lang.Object)
protected static boolean isIfdAllowed(int info, int ifd)
protected static int getAllowedIfdFlagsFromInfo(int info)
public boolean addGpsTags(double latitude, double longitude)
latitude
- a GPS latitude coordinate.longitude
- a GPS longitude coordinate.public boolean addGpsDateTimeStampTag(long timestamp)
timestamp
- a GPS timestamp.public double getApertureSize()
public java.lang.String getLensModelDescription()
TAG_LENS_MODEL
or TAG_LENS_SPECS
are foundpublic static byte[] toBitArray(short value)