Skip to content

How to use ReadRGBAImageOriented with Exif Orientation? #95

@catester

Description

@catester

For example I read Orientation exif value from tiff file like this:

var orientation = Orientation.BOTLEFT;
var value = tiff.GetField(TiffTag.ORIENTATION);
if (value != null)
    orientation = value[0].ToUShort();

And for example if orientation value is RIGHTTOP and reading the image like this

tiff.ReadRGBAImageOriented(width, height, raster, Orientation.RIGHTTOP)

The raster image is flipped vertically, but RIGHTTOP means rotate 90 degrees clockwise.

In you docs, I read that orientation parameter in ReadRGBAImageOriented method is "The raster origin position".
So how do we map exif orientation value to this raster origin position?

I noticed you need to use BOTLEFT to get correct image when the exif value is TOPLEFT which I thought should be the default value for orientation. So we need to reverse every value? But by which logic?

I thought ReadRGBAImageOriented method was intended for easily getting an oriented frame.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions