Dela via


ExifInterface Class

Definition

This is a class for reading and writing Exif tags in various image file formats.

[Android.Runtime.Register("android/media/ExifInterface", DoNotGenerateAcw=true)]
public class ExifInterface : Java.Lang.Object
[<Android.Runtime.Register("android/media/ExifInterface", DoNotGenerateAcw=true)>]
type ExifInterface = class
    inherit Object
Inheritance
ExifInterface
Attributes

Remarks

This is a class for reading and writing Exif tags in various image file formats.

<b>Note:</b> This class has known issues on some versions of Android. It is recommended to use the AndroidXExifInterface Library since it offers a superset of the functionality of this class and is more easily updateable. In addition to the functionality of this class, it supports parsing extra metadata such as exposure and data compression information as well as setting extra metadata such as GPS and datetime information.

Supported for reading: JPEG, PNG, WebP, HEIF, DNG, CR2, NEF, NRW, ARW, RW2, ORF, PEF, SRW, RAF, AVIF.

Supported for writing: JPEG, PNG, WebP.

Note: JPEG and HEIF files may contain XMP data either inside the Exif data chunk or outside of it. This class will search both locations for XMP data, but if XMP data exist both inside and outside Exif, will favor the XMP data inside Exif over the one outside.

Java documentation for android.media.ExifInterface.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

ExifInterface(File)

Reads Exif tags from the specified image file.

ExifInterface(FileDescriptor)

Reads Exif tags from the specified image file descriptor.

ExifInterface(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

ExifInterface(Stream, Int32)

Reads Exif tags from the specified image input stream based on the stream type.

ExifInterface(Stream)

Reads Exif tags from the specified image input stream.

ExifInterface(String)

Reads Exif tags from the specified image file.

Fields

StreamTypeExifDataOnly
Obsolete.

Constant used to indicate that the input stream contains only Exif data.

StreamTypeFullImageData
Obsolete.

Constant used to indicate that the input stream contains the full image data.

TagAperture

Type is double.

TagApertureValue

Type is rational.

TagArtist

Type is String.

TagBitsPerSample

Type is int.

TagBrightnessValue

Type is rational.

TagCfaPattern

Type is String.

TagColorSpace

Type is int.

TagComponentsConfiguration

Type is String.

TagCompressedBitsPerPixel

Type is rational.

TagCompression

Type is int.

TagContrast

Type is int.

TagCopyright

Type is String.

TagCustomRendered

Type is int.

TagDatetime

Type is String.

TagDatetimeDigitized

Type is String.

TagDatetimeOriginal

Type is String.

TagDefaultCropSize

Type is int.

TagDeviceSettingDescription

Type is String.

TagDigitalZoomRatio

Type is double.

TagDngVersion

Type is int.

TagExifVersion

Type is String.

TagExposureBiasValue

Type is double.

TagExposureIndex

Type is rational.

TagExposureMode

Type is int.

TagExposureProgram

Type is int.

TagExposureTime

Type is double.

TagFileSource

Type is String.

TagFlash

Type is int.

TagFlashEnergy

Type is rational.

TagFlashpixVersion

Type is String.

TagFNumber

Type is double.

TagFocalLength

Type is rational.

TagFocalLengthIn35mmFilm

Type is int.

TagFocalPlaneResolutionUnit

Type is int.

TagFocalPlaneXResolution

Type is rational.

TagFocalPlaneYResolution

Type is rational.

TagGainControl

Type is int.

TagGpsAltitude

The altitude (in meters) based on the reference in TAG_GPS_ALTITUDE_REF.

TagGpsAltitudeRef

0 if the altitude is above sea level.

TagGpsAreaInformation

Type is String.

TagGpsDatestamp

Type is String.

TagGpsDestBearing

Type is rational.

TagGpsDestBearingRef

Type is String.

TagGpsDestDistance

Type is rational.

TagGpsDestDistanceRef

Type is String.

TagGpsDestLatitude

Type is rational.

TagGpsDestLatitudeRef

Type is String.

TagGpsDestLongitude

Type is rational.

TagGpsDestLongitudeRef

Type is String.

TagGpsDifferential

Type is int.

TagGpsDop

Type is rational.

TagGpsImgDirection

Type is rational.

TagGpsImgDirectionRef

Type is String.

TagGpsLatitude

Type is rational.

TagGpsLatitudeRef

Type is String.

TagGpsLongitude

Type is rational.

TagGpsLongitudeRef

Type is String.

TagGpsMapDatum

Type is String.

TagGpsMeasureMode

Type is String.

TagGpsProcessingMethod

Type is String.

TagGpsSatellites

Type is String.

TagGpsSpeed

Type is rational.

TagGpsSpeedRef

Type is String.

TagGpsStatus

Type is String.

TagGpsTimestamp

Type is String.

TagGpsTrack

Type is rational.

TagGpsTrackRef

Type is String.

TagGpsVersionId

Type is String.

TagImageDescription

Type is String.

TagImageLength

Type is int.

TagImageUniqueId

Type is String.

TagImageWidth

Type is int.

TagInteroperabilityIndex

Type is String.

TagIso

Type is int.

TagIsoSpeedRatings

Type is int.

TagJpegInterchangeFormat

Type is int.

TagJpegInterchangeFormatLength

Type is int.

TagLightSource

Type is int.

TagMake

Type is String.

TagMakerNote

Type is String.

TagMaxApertureValue

Type is rational.

TagMeteringMode

Type is int.

TagModel

Type is String.

TagNewSubfileType

Type is int.

TagOecf

Type is String.

TagOffsetTime

A tag used to record the offset from UTC (the time difference from Universal Time Coordinated including daylight saving time) of the time of DateTime tag.

TagOffsetTimeDigitized

A tag used to record the offset from UTC (the time difference from Universal Time Coordinated including daylight saving time) of the time of DateTimeDigitized tag.

TagOffsetTimeOriginal

A tag used to record the offset from UTC (the time difference from Universal Time Coordinated including daylight saving time) of the time of DateTimeOriginal tag.

TagOrfAspectFrame

Type is int.

TagOrfPreviewImageLength

Type is int.

TagOrfPreviewImageStart

Type is int.

TagOrfThumbnailImage

Type is undefined.

TagOrientation

Type is int.

TagPhotometricInterpretation

Type is int.

TagPixelXDimension

Type is int.

TagPixelYDimension

Type is int.

TagPlanarConfiguration

Type is int.

TagPrimaryChromaticities

Type is rational.

TagReferenceBlackWhite

Type is rational.

TagRelatedSoundFile

Type is String.

TagResolutionUnit

Type is int.

TagRowsPerStrip

Type is int.

TagRw2Iso

Type is int.

TagRw2JpgFromRaw

Type is undefined.

TagRw2SensorBottomBorder

Type is int.

TagRw2SensorLeftBorder

Type is int.

TagRw2SensorRightBorder

Type is int.

TagRw2SensorTopBorder

Type is int.

TagSamplesPerPixel

Type is int.

TagSaturation

Type is int.

TagSceneCaptureType

Type is int.

TagSceneType

Type is String.

TagSensingMethod

Type is int.

TagSharpness

Type is int.

TagShutterSpeedValue

Type is rational.

TagSoftware

Type is String.

TagSpatialFrequencyResponse

Type is String.

TagSpectralSensitivity

Type is String.

TagStripByteCounts

Type is int.

TagStripOffsets

Type is int.

TagSubfileType

Type is int.

TagSubjectArea

Type is int.

TagSubjectDistance

Type is double.

TagSubjectDistanceRange

Type is int.

TagSubjectLocation

Type is int.

TagSubsecTime

Type is String.

TagSubsecTimeDig

Type is String.

TagSubsecTimeDigitized

Type is String.

TagSubsecTimeOrig

Type is String.

TagSubsecTimeOriginal

Type is String.

TagThumbnailImageLength

Type is int.

TagThumbnailImageWidth

Type is int.

TagThumbnailOrientation

Type is int.

TagTransferFunction

Type is int.

TagUserComment

Type is String.

TagWhiteBalance

Type is int.

TagWhitePoint

Type is rational.

TagXmp

Type is byte[].

TagXResolution

Type is rational.

TagYCbCrCoefficients

Type is rational.

TagYCbCrPositioning

Type is int.

TagYCbCrSubSampling

Type is int.

TagYResolution

Type is rational.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
DateTime

Returns parsed #TAG_DATETIME value, or -1 if unavailable or invalid.

DateTimeDigitized

Returns parsed #TAG_DATETIME_DIGITIZED value, or -1 if unavailable or invalid.

DateTimeOriginal

Returns parsed #TAG_DATETIME_ORIGINAL value, or -1 if unavailable or invalid.

GpsDateTime

Returns number of milliseconds since Jan.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasThumbnail

Returns true if the image file has a thumbnail.

IsThumbnailCompressed

Returns true if thumbnail image is JPEG Compressed, or false if either thumbnail image does not exist or thumbnail image is uncompressed.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThumbnailBitmap

Creates and returns a Bitmap object of the thumbnail image based on the byte array and the thumbnail compression value, or null if the compression type is unsupported.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetAltitude(Double)

Return the altitude in meters.

GetAttribute(String)

Returns the value of the specified tag or null if there is no such tag in the image file.

GetAttributeBytes(String)

Returns the raw bytes for the value of the requested tag inside the image file, or null if the tag is not contained.

GetAttributeDouble(String, Double)

Returns the double value of the tag that is specified as rational or contains a double-formatted value.

GetAttributeInt(String, Int32)

Returns the integer value of the specified tag.

GetAttributeRange(String)

Returns the offset and length of the requested tag inside the image file, or null if the tag is not contained.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetLatLong(Single[])

Stores the latitude and longitude value in a float array.

GetThumbnail()

Returns the JPEG compressed thumbnail inside the image file, or null if there is no JPEG compressed thumbnail.

GetThumbnailBytes()

Returns the thumbnail bytes inside the image file, regardless of the compression type of the thumbnail image.

GetThumbnailRange()

Returns the offset and length of thumbnail inside the image file, or null if either there is no thumbnail or the thumbnail bytes are stored non-consecutively.

HasAttribute(String)

Returns true if the image file has the given attribute defined.

IsSupportedMimeType(String)

Returns whether ExifInterface currently supports reading data from the specified mime type or not.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SaveAttributes()

Save the tag data into the original image file.

SetAttribute(String, String)

Set the value of the specified tag.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to