Page 1 of 1

Identify the orientation and rotate only specific pages of a TIFF file

Posted: 2017-07-05T23:45:37-07:00
by HariK
Hi All,

I have a multi-page TIFF file in which some of the pages are rotated and some of the pages are not rotated.

I am using Magick.NET-Q16-AnyCPU dll of version 7.0.0.0 in my C# application. I tried exploring the ImageMagick API's but at least I couldn't find any API methods which does the above mentioned. Can someone please point me towards a sample example of ImageMagick with C# on --> How can we detect the orientation of any page in a TIFF file and then rotate only that specific page/s of a TIFF file ?

Thanks in Advance,
Hari

Re: Identify the orientation and rotate only specific pages of a TIFF file

Posted: 2017-07-06T08:52:39-07:00
by fmw42
Can you post an example tiff that has pages that are rotated? What angle are the rotations --- are they small or 90,180,270 deg rotations?

You can upload to some free hosting service and put the URL here.

Re: Identify the orientation and rotate only specific pages of a TIFF file

Posted: 2017-07-09T22:20:36-07:00
by HariK
@fmw42, thanks for your reply. Sorry I cannot post my tiff file. Yes, the angles of rotations are 90, 180 and 270 degrees.

Re: Identify the orientation and rotate only specific pages of a TIFF file

Posted: 2017-07-10T09:23:08-07:00
by fmw42
It may be possible to detect 0 and 180 vs 90 and 270. But that will not tell you whether you have 0 or 180 and likewise 90 or 270. If you average to one row or one column, the correct one will show repeated gaps corresponding to the rows. Similarly there will be a different in orientation showing in the FFT magnitude.