Google is committed to advancing racial equity for Black communities. See how.

ImageInfo

interface ImageInfo
androidx.camera.core.ImageInfo

Metadata for an image.

Summary

Public methods

abstract Int

Returns the rotation needed to transform the image to the correct orientation.

abstract Long

Returns the timestamp of the metadata.

Public methods

getRotationDegrees

abstract fun getRotationDegrees(): Int

Returns the rotation needed to transform the image to the correct orientation.

This is a clockwise rotation in degrees that needs to be applied to the image buffer. Note that for images that are in android.graphics.ImageFormat#JPEG this value will match the rotation defined in the EXIF.

The target rotation is set at the time the image capture was requested.

The correct orientation of the image is dependent upon the producer of the image. For example, if the ImageProxy that contains this instance of ImageInfo is produced by an ImageCapture, then the rotation will be determined by ImageCapture#setTargetRotation(int) or ImageCapture.Builder#setTargetRotation(int).

Return
Int The rotation in degrees which will be a value in {0, 90, 180, 270}.

getTimestamp

abstract fun getTimestamp(): Long

Returns the timestamp of the metadata. Details on the timestamp depend on the source providing the image, and the method providing the image contains more documentation.

Return
Long the timestamp of the image