class Exify
This class provides methods and constants for reading and writing jpeg file metadata. It contains a collection of ExifTags, and a collection of definitions for creating valid ExifTags. The collection of ExifTags can be updated by: reading new ones from a file, deleting or adding existing ones, or building new ExifTags from a tag definition. These ExifTags can be written to a valid jpeg image as exif metadata.
Each ExifTag has a tag ID (TID) and is stored in a specific image file directory (IFD) as specified by the exif standard. A tag definition can be looked up with a constant that is a combination of TID and IFD. This definition has information about the type, number of components, and valid IFDs for a ExifTagKey.See Also
ExifTagInfo
interface ColorSpace
Constants for {@see #ExifTagKey.COLOR_SPACE} |
|
interface ComponentsConfiguration
Constants for {@see #ExifTagKey.COMPONENTS_CONFIGURATION} |
|
interface Compression
Constants for {@see #ExifTagKey.COMPRESSION} |
|
interface Contrast
Constants for {@see #ExifTagKey.CONTRAST} |
|
interface ExposureMode
Constants for {@see #ExifTagKey.EXPOSURE_MODE} |
|
interface ExposureProgram
Constants for {@see #ExifTagKey.EXPOSURE_PROGRAM} |
|
interface FileSource
Constants for {@see #ExifTagKey.FILE_SOURCE} |
|
interface Flash
Constants for {@see #ExifTagKey.FLASH} As the definition in Jeita EXIF 2.2 |
|
interface GainControl
Constants for {@see #ExifTagKey.GAIN_CONTROL} |
|
interface GpsAltitudeRef
Constants for {@see #ExifTagKey.GPS_ALTITUDE_REF} |
|
interface GpsDifferential
Constants for {@see #ExifTagKey.GPS_DIFFERENTIAL} |
|
interface GpsLatitudeRef
Constants for {@see #ExifTagKey.GPS_LATITUDE_REF}, {@see #ExifTagKey.GPS_DEST_LATITUDE_REF} |
|
interface GpsLongitudeRef
Constants for {@see #ExifTagKey.GPS_LONGITUDE_REF}, {@see #ExifTagKey.GPS_DEST_LONGITUDE_REF} |
|
interface GpsMeasureMode
Constants for {@see #ExifTagKey.GPS_MEASURE_MODE} |
|
interface GpsSpeedRef
Constants for {@see #ExifTagKey.GPS_SPEED_REF}, {@see #ExifTagKey.GPS_DEST_DISTANCE_REF} |
|
interface GpsStatus
Constants for {@see #ExifTagKey.GPS_STATUS} |
|
interface GpsTrackRef
Constants for {@see #ExifTagKey.GPS_TRACK_REF}, {@see #ExifTagKey.GPS_IMG_DIRECTION_REF}, {@see #ExifTagKey.GPS_DEST_BEARING_REF} |
|
interface JpegProcess
Constants for the jpeg process algorithm used. |
|
interface LightSource
Constants for {@see #ExifTagKey.LIGHT_SOURCE} |
|
interface MeteringMode
Constants for {@see #ExifTagKey.METERING_MODE} |
|
interface Options
Options for calling |
|
interface Orientation
Constants for {@see #ExifTagKey.ORIENTATION}. They can be interpreted as follows:
|
|
interface PhotometricInterpretation
Constants for {@see #ExifTagKey.PHOTOMETRIC_INTERPRETATION} |
|
interface PlanarConfiguration
Constants for {@see #ExifTagKey.PLANAR_CONFIGURATION} |
|
interface ResolutionUnit
Constants for {@see #ExifTagKey.RESOLUTION_UNIT} |
|
interface Saturation
Constants for {@see #ExifTagKey.SATURATION} |
|
interface SceneCapture
Constants for {@see #ExifTagKey.SCENE_CAPTURE_TYPE} |
|
interface SceneType
Constants for {@see #ExifTagKey.SCENE_TYPE} |
|
interface SensingMethod
Constants for {@see #ExifTagKey.SENSING_METHOD} |
|
interface SensitivityType
Constants for the {@see #ExifTagKey.SENSITIVITY_TYPE} tag |
|
interface Sharpness
Constants for {@see #ExifTagKey.SHARPNESS} |
|
interface SubjectDistance
Constants for {@see #ExifTagKey.SUBJECT_DISTANCE} |
|
class TAG |
|
interface WhiteBalance
Constants for {@see #ExifTagKey.WHITE_BALANCE} |
|
interface YCbCrPositioning
Constants for {@see #ExifTagKey.Y_CB_CR_POSITIONING} |
Exify() |
fun addDateTimeStampTag(tag: Exify.TAG, timestamp: long, timezone: java.util.TimeZone): boolean
Creates, formats, and sets the DateTimeStamp tag for one of: {@see #ExifTagKey.DATE_TIME}, {@see #ExifTagKey.DATE_TIME_DIGITIZED}, {@see #ExifTagKey.DATE_TIME_ORIGINAL}. |
|
fun addGpsDateTimeStampTag(timestamp: long): boolean
Creates and sets the GPS timestamp ExifTagKey. |
|
fun addGpsTags(latitude: double, longitude: double): boolean
Creates and sets all to the GPS tags for a give latitude and longitude. |
|
fun buildTag(tag: Exify.TAG, val: java.lang.Object): ExifTagInfo
Creates a tag for a defined tag constant in the tag's default IFD. fun buildTag(tagId: int, ifdId: int, val: java.lang.Object): ExifTagInfo
Creates a tag for a defined tag constant in a given IFD if that IFD is allowed for the ExifTagKey. This method will fail anytime the appropriate |
|
fun buildUninitializedTag(tag: Exify.TAG): ExifTagInfo fun buildUninitializedTag(tagId: int): ExifTagInfo |
|
fun clearExif(): void
Clears this ExifInterface object's existing exif tags. |
|
static fun closeSilently(c: java.io.Closeable): void |
|
static fun convertLatOrLongToDouble(coordinate: kotlin.Array<Rational>, reference: java.lang.String): double
Gets the double representation of the GPS latitude or longitude coordinate. |
|
static fun defineTag(ifdId: int, tagId: short): int
Returns the constant representing a tag with a given TID and default IFD. |
|
fun deleteTag(tag: Exify.TAG): void fun deleteTag(tagId: int): void
Removes the ExifTag for a tag constant from that tag's default IFD. fun deleteTag(tagId: int, ifdId: int): void
Removes the ExifTag for a tag constant from the given IFD. |
|
fun getActualTagCount(tagId: int, ifdId: int): int
Gets the number of elements for an ExifTag in a given IFD. |
|
static fun getAllowedIfdFlagsFromInfo(info: int): int |
|
static fun getAllowedIfdsFromInfo(info: int): kotlin.Array<int> |
|
fun getAllTags(): java.util.List<ExifTagInfo>
Get the exif tags in this ExifInterface object or null if none exist. |
|
fun getAltitude(defaultValue: double): double
Return the altitude in meters. If the exif tag does not exist, return defaultValue. |
|
fun getApertureSize(): double
Return the aperture size, if present, 0 if missing |
|
static fun getComponentCountFromInfo(info: int): int |
|
static fun getDateTime(dateTimeString: java.lang.String, timeZone: java.util.TimeZone): java.util.Date
Given an exif date time, like {@see #ExifTagKey.DATE_TIME} or {@see #ExifTagKey.DATE_TIME_DIGITIZED} returns a java Date object |
|
fun getDefinedTagCount(tag: Exify.TAG): int fun getDefinedTagCount(tagId: int): int
Gets the defined number of elements for a ExifTagKey. |
|
fun getDefinedTagDefaultIfd(tagId: int): int
Gets the default IFD for a ExifTagKey. |
|
fun getDefinedTagType(tagId: int): short
Gets the defined type for a ExifTagKey. |
|
static fun getFlagsFromAllowedIfds(allowedIfds: kotlin.Array<int>): int |
|
fun getImageSize(): kotlin.Array<int>
Returns the Image size as decoded from the SOF marker |
|
fun getJpegProcess(): short
this gives information about the process used to create the JPEG file. Possible values are:
|
|
fun getLatitude(): java.lang.String
Returns a formatted String with the latitude representation: 39° 8' 16.8" N |
|
fun getLatLongAsDoubles(): kotlin.Array<double>
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. |
|
fun getLensModelDescription(): java.lang.String
Returns the lens model as string if any of the tags {@see #ExifTagKey.LENS_MODEL} or {@see #ExifTagKey.LENS_SPECS} are found |
|
fun getLongitude(): java.lang.String
Returns a formatted String with the longitude representation: 77° 37' 51.6" W |
|
static fun getOrientationValueForRotation(degrees: int): short
Returns the Orientation ExifTag value for a given number of degrees. |
|
fun getQualityGuess(): int
Returns the JPEG quality used to generate the image or 0 if not found |
|
fun getResolutionUnit(resolution: int): double
Given the value from {@see #ExifTagKey.FOCAL_PLANE_RESOLUTION_UNIT} or {@see #ExifTagKey.RESOLUTION_UNIT} this method will return the corresponding value in millimeters |
|
static fun getRotationForOrientationValue(orientation: short): int
Returns the rotation degrees corresponding to an ExifTag Orientation value. |
|
fun getTag(tagId: int): ExifTagInfo fun getTag(tag: Exify.TAG): ExifTagInfo
Returns the ExifTag in that tag's default IFD for a defined tag constant or null if none exists. fun getTag(tagId: int, ifdId: int): ExifTagInfo
Gets an ExifTag for an IFD other than the tag's default. |
|
fun getTagByteValue(tag: Exify.TAG): java.lang.Byte fun getTagByteValue(tagId: int): java.lang.Byte fun getTagByteValue(tagId: int, ifdId: int): java.lang.Byte |
|
fun getTagByteValues(tagId: int, ifdId: int): kotlin.Array<byte> fun getTagByteValues(tagId: int): kotlin.Array<byte> fun getTagByteValues(tag: Exify.TAG): kotlin.Array<byte> |
|
fun getTagDefinition(tagId: short, defaultIfd: int): int |
|
fun getTagDefinitionForTag(tag: ExifTagInfo): int fun getTagDefinitionForTag(tagId: short, type: short, count: int, ifd: int): int |
|
fun getTagDefinitionsForTagId(tagId: short): kotlin.Array<int> |
|
fun getTagInfo(): SparseIntArray |
|
fun getTagIntValue(tag: Exify.TAG): java.lang.Integer fun getTagIntValue(tagId: int): java.lang.Integer fun getTagIntValue(tagId: int, ifdId: int): java.lang.Integer |
|
fun getTagIntValues(tagId: int, ifdId: int): kotlin.Array<int> fun getTagIntValues(tagId: int): kotlin.Array<int> fun getTagIntValues(tag: Exify.TAG): kotlin.Array<int> |
|
fun getTagLongValue(tag: Exify.TAG): java.lang.Long fun getTagLongValue(tagId: int): java.lang.Long fun getTagLongValue(tagId: int, ifdId: int): java.lang.Long |
|
fun getTagLongValues(tagId: int, ifdId: int): kotlin.Array<long> fun getTagLongValues(tagId: int): kotlin.Array<long> fun getTagLongValues(tag: Exify.TAG): kotlin.Array<long> |
|
fun getTagRationalValue(tag: Exify.TAG): Rational fun getTagRationalValue(tagId: int): Rational fun getTagRationalValue(tagId: int, ifdId: int): Rational |
|
fun getTagRationalValues(tagId: int, ifdId: int): kotlin.Array<Rational> fun getTagRationalValues(tagId: int): kotlin.Array<Rational> fun getTagRationalValues(tag: Exify.TAG): kotlin.Array<Rational> |
|
fun getTagsForIfdId(ifdId: int): java.util.List<ExifTagInfo>
Returns a list of ExifTags that share an IFD (which can be obtained by calling |
|
fun getTagsForTagId(tagId: short): java.util.List<ExifTagInfo>
Returns a list of ExifTags that share a TID (which can be obtained by calling |
|
fun getTagStringValue(tagId: int, ifdId: int): java.lang.String fun getTagStringValue(tagId: int): java.lang.String fun getTagStringValue(tag: Exify.TAG): java.lang.String |
|
fun getTagValue(tag: Exify.TAG): java.lang.Object fun getTagValue(tagId: int): java.lang.Object
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. fun getTagValue(tagId: int, ifdId: int): java.lang.Object
Gets a tag value for an IFD other than the tag's default. |
|
fun getThumbnail(): kotlin.Array<byte>
Returns the thumbnail if it is jpeg compressed, or null if none exists. |
|
fun getThumbnailBitmap(): Bitmap
Returns the thumbnail from IFD1 as a bitmap, or null if none exists. |
|
fun getThumbnailBytes(): kotlin.Array<byte>
Returns the thumbnail from IFD1 as a byte array, or null if none exists. The bytes may either be an uncompressed strip as specified in the exif standard or a jpeg compressed image. |
|
static fun getTrueIfd(tag: Exify.TAG): int static fun getTrueIfd(tag: int): int
Returns the default IFD for a tag constant. |
|
static fun getTrueTagKey(tag: Exify.TAG): short static fun getTrueTagKey(tag: int): short
Returns the TID for a tag constant. |
|
static fun getTypeFromInfo(info: int): short |
|
fun getUserComment(): java.lang.String
Decodes the user comment tag into string as specified in the EXIF standard. Returns null if decoding failed. |
|
fun hasThumbnail(): boolean
Check if thumbnail exists. |
|
static fun isIfdAllowed(info: int, ifd: int): boolean |
|
static fun isOffsetTag(tag: short): boolean
Returns true if tag TID is one of the following: {@see #ExifTagKey.EXIF_IFD}, {@see #ExifTagKey.GPS_IFD}, {@see #ExifTagKey.JPEG_INTERCHANGE_FORMAT}, {@see #ExifTagKey.STRIP_OFFSETS}, {@see #ExifTagKey.INTEROPERABILITY_IFD} |
|
fun isTagCountDefined(tagId: int): boolean
Checks whether a tag has a defined number of elements. |
|
fun isThumbnailCompressed(): boolean
Check if thumbnail is compressed. |
|
fun readExif(inFileName: java.lang.String, options: int): void
Reads the exif tags from a file, clearing this ExifInterface object's existing exif tags. fun readExif(inStream: java.io.InputStream, options: int): void
Reads the exif tags from an InputStream, clearing this ExifInterface object's existing exif tags.
fun readExif(jpeg: kotlin.Array<byte>, options: int): void
Reads the exif tags from a byte array, clearing this ExifInterface object's existing exif tags. |
|
fun removeCompressedThumbnail(): void
Clears the compressed thumbnail if it exists. |
|
fun removeTagDefinition(tagId: int): void
Removes a tag definition for given defined tag constant. |
|
fun resetTagDefinitions(): void
Resets tag definitions to the default ones. |
|
fun setCompressedThumbnail(thumb: Bitmap): boolean
Sets the thumbnail to be a jpeg compressed bitmap. Clears any prior thumbnail. fun setCompressedThumbnail(thumb: kotlin.Array<byte>): boolean
Sets the thumbnail to be a jpeg compressed image. Clears any prior thumbnail. |
|
fun setExif(tags: java.util.Collection<ExifTagInfo>): void
Sets the exif tags, clearing this ExifInterface object's existing exif tags. |
|
fun setTag(tag: ExifTagInfo): ExifTagInfo
Puts an ExifTag into this ExifInterface object's tags, removing a previous ExifTag with the same TID and IFD. The IFD it is put into will be the one the tag was created with in |
|
fun setTagDefinition(tagId: short, defaultIfd: int, tagType: short, defaultComponentCount: short, allowedIfds: kotlin.Array<int>): int
Creates a new tag definition in this ExifInterface object for a given TID and default IFD. Creating a definition with the same TID and default IFD as a previous definition will override it. |
|
fun setTags(tags: java.util.Collection<ExifTagInfo>): void
Puts a collection of ExifTags into this ExifInterface objects's tags. Any previous ExifTags with the same TID and IFDs will be removed. |
|
fun setTagValue(tag: Exify.TAG, val: java.lang.Object): boolean fun setTagValue(tagId: int, val: java.lang.Object): boolean
Sets the value of an ExifTag if it exists it's default IFD. The value must be the correct type and length for that ExifExifTagKey. fun setTagValue(tagId: int, ifdId: int, val: java.lang.Object): boolean
Sets the value of an ExifTag if it exists in the given IFD. The value must be the correct type and length for that ExifExifTagKey. |
|
static fun toBitArray(value: short): kotlin.Array<byte> |
|
fun writeExif(dstFilename: java.lang.String): void fun writeExif(srcFilename: java.lang.String, dstFilename: java.lang.String): void fun writeExif(input: java.io.InputStream, dstFilename: java.lang.String): void fun writeExif(input: Bitmap, dstFilename: java.lang.String, quality: int): void |
DEFAULT_BYTE_ORDER |
|
DEFINITION_NULL |
|
IFD_NULL |
|
sBannedDefines
Tags with definitions that cannot be overridden (banned defines). |
|
TAG_NULL |