Detect Tiff Orientation

Is there a way to detect the tiff orientation? We have faxes sent in on legal but the document is really letter, so there is a bunch of white space at the bottom. I’m doing a crop and resample to get it down to letter, and if they submit the image upside down I crop the top instead of the white space at the bottom. Am I doing this right? If so, how can I figure out the orientation of the submitted image and check if it’s orientated right?

Hi Cody,

Thank you for your inquiry.

You can use Orientation property that is associated with TiffFrame because a TIFF image could have one or more frames. You can access the property by using FrameOptions class as demonstrated below.

TiffImage image = (TiffImage)Image.Load(input);
foreach (TiffFrame frame in image.Frames)
{
Console.WriteLine(frame.FrameOptions.Orientation);
}

Hope the above information helps. Please feel free to write us back in case you have further concerns or questions for us.