Table of Contents

Enum ImageOrientation

Namespace
Egami.Metadata
Assembly
Egami.dll

How stored pixels must be turned to show the image upright: the EXIF Orientation tag (274). The value says which way the camera was held; AutoOrient applies it.

public enum ImageOrientation

Fields

FlipHorizontal = 2

Mirrored left to right (EXIF 2).

FlipVertical = 4

Mirrored top to bottom (EXIF 4).

Normal = 1

Stored upright (EXIF 1). Also used when a file says nothing.

Rotate180 = 3

Upside down (EXIF 3).

Rotate270 = 8

Needs a 270° clockwise turn to show upright (EXIF 8).

Rotate90 = 6

Needs a 90° clockwise turn to show upright (EXIF 6), as from a phone held upright.

Transpose = 5

Mirrored along the top-left to bottom-right diagonal (EXIF 5).

Transverse = 7

Mirrored along the top-right to bottom-left diagonal (EXIF 7).

Unknown = 0

Not a valid EXIF value; treated as Normal. Readers report Normal when a file says nothing.

Examples

// Load returns pixels as stored. A phone photo stored sideways says so in its EXIF orientation.
RasterInfo info = Raster.Probe("sideways.jpg");
Console.WriteLine(info.Orientation);   // Rotate90

// AutoOrient turns the pixels upright and resets the tag. Followed by a resize, the resize runs first, on the stored image,
// so only the small result is turned.
using Raster photo = Raster.Load("sideways.jpg");
photo.Apply(ops => ops.AutoOrient().Fit(300, 300), Ct);