open 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() |
static val DEFAULT_BYTE_ORDER: ByteOrder! |
|
static val DEFINITION_NULL: Int |
|
static val IFD_NULL: Int |
|
static var sBannedDefines: HashSet<Short!>!
Tags with definitions that cannot be overridden (banned defines). |
|
static val TAG_NULL: Int |
open fun addDateTimeStampTag(tag: Exify.TAG!, timestamp: Long, timezone: 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}. |
|
open fun addGpsDateTimeStampTag(timestamp: Long): Boolean
Creates and sets the GPS timestamp ExifTagKey. |
|
open fun addGpsTags(latitude: Double, longitude: Double): Boolean
Creates and sets all to the GPS tags for a give latitude and longitude. |
|
open fun buildTag(tag: Exify.TAG!, val: Any!): ExifTagInfo!
Creates a tag for a defined tag constant in the tag's default IFD. open fun buildTag(tagId: Int, ifdId: Int, val: Any!): 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 |
|
open fun buildUninitializedTag(tag: Exify.TAG!): ExifTagInfo! open fun buildUninitializedTag(tagId: Int): ExifTagInfo! |
|
open fun clearExif(): Unit
Clears this ExifInterface object's existing exif tags. |
|
open static fun closeSilently(c: Closeable!): Unit |
|
open static fun convertLatOrLongToDouble(coordinate: Array<Rational!>!, reference: String!): Double
Gets the double representation of the GPS latitude or longitude coordinate. |
|
open static fun defineTag(ifdId: Int, tagId: Short): Int
Returns the constant representing a tag with a given TID and default IFD. |
|
open fun deleteTag(tag: Exify.TAG!): Unit open fun deleteTag(tagId: Int): Unit
Removes the ExifTag for a tag constant from that tag's default IFD. open fun deleteTag(tagId: Int, ifdId: Int): Unit
Removes the ExifTag for a tag constant from the given IFD. |
|
open fun getActualTagCount(tagId: Int, ifdId: Int): Int
Gets the number of elements for an ExifTag in a given IFD. |
|
open static fun getAllowedIfdFlagsFromInfo(info: Int): Int |
|
open static fun getAllowedIfdsFromInfo(info: Int): IntArray! |
|
open fun getAllTags(): MutableList<ExifTagInfo!>!
Get the exif tags in this ExifInterface object or null if none exist. |
|
open fun getAltitude(defaultValue: Double): Double
Return the altitude in meters. If the exif tag does not exist, return defaultValue. |
|
open fun getApertureSize(): Double
Return the aperture size, if present, 0 if missing |
|
open static fun getComponentCountFromInfo(info: Int): Int |
|
open static fun getDateTime(dateTimeString: String!, timeZone: TimeZone!): Date!
Given an exif date time, like {@see #ExifTagKey.DATE_TIME} or {@see #ExifTagKey.DATE_TIME_DIGITIZED} returns a java Date object |
|
open fun getDefinedTagCount(tag: Exify.TAG!): Int open fun getDefinedTagCount(tagId: Int): Int
Gets the defined number of elements for a ExifTagKey. |
|
open fun getDefinedTagDefaultIfd(tagId: Int): Int
Gets the default IFD for a ExifTagKey. |
|
open fun getDefinedTagType(tagId: Int): Short
Gets the defined type for a ExifTagKey. |
|
open static fun getFlagsFromAllowedIfds(allowedIfds: IntArray!): Int |
|
open fun getImageSize(): IntArray!
Returns the Image size as decoded from the SOF marker |
|
open fun getJpegProcess(): Short
this gives information about the process used to create the JPEG file. Possible values are:
|
|
open fun getLatitude(): String!
Returns a formatted String with the latitude representation: 39° 8' 16.8" N |
|
open fun getLatLongAsDoubles(): DoubleArray!
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. |
|
open fun getLensModelDescription(): String!
Returns the lens model as string if any of the tags {@see #ExifTagKey.LENS_MODEL} or {@see #ExifTagKey.LENS_SPECS} are found |
|
open fun getLongitude(): String!
Returns a formatted String with the longitude representation: 77° 37' 51.6" W |
|
open static fun getOrientationValueForRotation(degrees: Int): Short
Returns the Orientation ExifTag value for a given number of degrees. |
|
open fun getQualityGuess(): Int
Returns the JPEG quality used to generate the image or 0 if not found |
|
open 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 |
|
open static fun getRotationForOrientationValue(orientation: Short): Int
Returns the rotation degrees corresponding to an ExifTag Orientation value. |
|
open fun getTag(tagId: Int): ExifTagInfo! open 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. open fun getTag(tagId: Int, ifdId: Int): ExifTagInfo!
Gets an ExifTag for an IFD other than the tag's default. |
|
open fun getTagByteValue(tag: Exify.TAG!): Byte! open fun getTagByteValue(tagId: Int): Byte! open fun getTagByteValue(tagId: Int, ifdId: Int): Byte! |
|
open fun getTagByteValues(tagId: Int, ifdId: Int): ByteArray! open fun getTagByteValues(tagId: Int): ByteArray! open fun getTagByteValues(tag: Exify.TAG!): ByteArray! |
|
open fun getTagDefinition(tagId: Short, defaultIfd: Int): Int |
|
open fun getTagDefinitionForTag(tag: ExifTagInfo!): Int open fun getTagDefinitionForTag(tagId: Short, type: Short, count: Int, ifd: Int): Int |
|
open fun getTagDefinitionsForTagId(tagId: Short): IntArray! |
|
open fun getTagInfo(): SparseIntArray! |
|
open fun getTagIntValue(tag: Exify.TAG!): Int! open fun getTagIntValue(tagId: Int): Int! open fun getTagIntValue(tagId: Int, ifdId: Int): Int! |
|
open fun getTagIntValues(tagId: Int, ifdId: Int): IntArray! open fun getTagIntValues(tagId: Int): IntArray! open fun getTagIntValues(tag: Exify.TAG!): IntArray! |
|
open fun getTagLongValue(tag: Exify.TAG!): Long! open fun getTagLongValue(tagId: Int): Long! open fun getTagLongValue(tagId: Int, ifdId: Int): Long! |
|
open fun getTagLongValues(tagId: Int, ifdId: Int): LongArray! open fun getTagLongValues(tagId: Int): LongArray! open fun getTagLongValues(tag: Exify.TAG!): LongArray! |
|
open fun getTagRationalValue(tag: Exify.TAG!): Rational! open fun getTagRationalValue(tagId: Int): Rational! open fun getTagRationalValue(tagId: Int, ifdId: Int): Rational! |
|
open fun getTagRationalValues(tagId: Int, ifdId: Int): Array<Rational!>! open fun getTagRationalValues(tagId: Int): Array<Rational!>! open fun getTagRationalValues(tag: Exify.TAG!): Array<Rational!>! |
|
open fun getTagsForIfdId(ifdId: Int): MutableList<ExifTagInfo!>!
Returns a list of ExifTags that share an IFD (which can be obtained by calling |
|
open fun getTagsForTagId(tagId: Short): MutableList<ExifTagInfo!>!
Returns a list of ExifTags that share a TID (which can be obtained by calling |
|
open fun getTagStringValue(tagId: Int, ifdId: Int): String! open fun getTagStringValue(tagId: Int): String! open fun getTagStringValue(tag: Exify.TAG!): String! |
|
open fun getTagValue(tag: Exify.TAG!): Any! open fun getTagValue(tagId: Int): Any!
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. open fun getTagValue(tagId: Int, ifdId: Int): Any!
Gets a tag value for an IFD other than the tag's default. |
|
open fun getThumbnail(): ByteArray!
Returns the thumbnail if it is jpeg compressed, or null if none exists. |
|
open fun getThumbnailBitmap(): Bitmap!
Returns the thumbnail from IFD1 as a bitmap, or null if none exists. |
|
open fun getThumbnailBytes(): ByteArray!
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. |
|
open static fun getTrueIfd(tag: Exify.TAG!): Int open static fun getTrueIfd(tag: Int): Int
Returns the default IFD for a tag constant. |
|
open static fun getTrueTagKey(tag: Exify.TAG!): Short open static fun getTrueTagKey(tag: Int): Short
Returns the TID for a tag constant. |
|
open static fun getTypeFromInfo(info: Int): Short |
|
open fun getUserComment(): String!
Decodes the user comment tag into string as specified in the EXIF standard. Returns null if decoding failed. |
|
open fun hasThumbnail(): Boolean
Check if thumbnail exists. |
|
open static fun isIfdAllowed(info: Int, ifd: Int): Boolean |
|
open 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} |
|
open fun isTagCountDefined(tagId: Int): Boolean
Checks whether a tag has a defined number of elements. |
|
open fun isThumbnailCompressed(): Boolean
Check if thumbnail is compressed. |
|
open fun readExif(inFileName: String!, options: Int): Unit
Reads the exif tags from a file, clearing this ExifInterface object's existing exif tags. open fun readExif(inStream: InputStream!, options: Int): Unit
Reads the exif tags from an InputStream, clearing this ExifInterface object's existing exif tags.
open fun readExif(jpeg: ByteArray!, options: Int): Unit
Reads the exif tags from a byte array, clearing this ExifInterface object's existing exif tags. |
|
open fun removeCompressedThumbnail(): Unit
Clears the compressed thumbnail if it exists. |
|
open fun removeTagDefinition(tagId: Int): Unit
Removes a tag definition for given defined tag constant. |
|
open fun resetTagDefinitions(): Unit
Resets tag definitions to the default ones. |
|
open fun setCompressedThumbnail(thumb: Bitmap!): Boolean
Sets the thumbnail to be a jpeg compressed bitmap. Clears any prior thumbnail. open fun setCompressedThumbnail(thumb: ByteArray!): Boolean
Sets the thumbnail to be a jpeg compressed image. Clears any prior thumbnail. |
|
open fun setExif(tags: MutableCollection<ExifTagInfo!>!): Unit
Sets the exif tags, clearing this ExifInterface object's existing exif tags. |
|
open 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 |
|
open fun setTagDefinition(tagId: Short, defaultIfd: Int, tagType: Short, defaultComponentCount: Short, allowedIfds: IntArray!): 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. |
|
open fun setTags(tags: MutableCollection<ExifTagInfo!>!): Unit
Puts a collection of ExifTags into this ExifInterface objects's tags. Any previous ExifTags with the same TID and IFDs will be removed. |
|
open fun setTagValue(tag: Exify.TAG!, val: Any!): Boolean open fun setTagValue(tagId: Int, val: Any!): 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. open fun setTagValue(tagId: Int, ifdId: Int, val: Any!): 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. |
|
open static fun toBitArray(value: Short): ByteArray! |
|
open fun writeExif(dstFilename: String!): Unit open fun writeExif(srcFilename: String!, dstFilename: String!): Unit open fun writeExif(input: InputStream!, dstFilename: String!): Unit open fun writeExif(input: Bitmap!, dstFilename: String!, quality: Int): Unit |