Contents

UIImage.Orientation

Constants that specify the intended display orientation for an image.

Declaration

enum Orientation

Overview

Orientation values are commonly found in image metadata, and specifying image orientation correctly can be important both for displaying the image and for certain kinds of image processing.

The UIImage class automatically handles the transform necessary to present an image in the correct display orientation according to its orientation metadata, so an image object’s imageOrientation property simply indicates which transform was applied.

For example, an iOS device camera always encodes pixel data in the camera sensor’s native landscape orientation, along with metadata indicating the camera orientation. When UIImage loads a photo shot in portrait orientation, it automatically applies a 90° rotation before displaying the image data, and the image’s imageOrientation value of UIImage.Orientation.right indicates that this rotation has been applied.

[Image]

Topics

Image orientations

Initializers

See Also

Related Documentation

Accessing image attributes