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

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
HariK
Posts: 5
Joined: 2017-06-09T00:24:58-07:00
Authentication code: 1151

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

Post by HariK » 2017-07-05T23:45:37-07:00

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

User avatar
fmw42
Posts: 22087
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2017-07-06T08:52:39-07:00

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.

HariK
Posts: 5
Joined: 2017-06-09T00:24:58-07:00
Authentication code: 1151

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

Post by HariK » 2017-07-09T22:20:36-07:00

@fmw42, thanks for your reply. Sorry I cannot post my tiff file. Yes, the angles of rotations are 90, 180 and 270 degrees.

User avatar
fmw42
Posts: 22087
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2017-07-10T09:23:08-07:00

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.

Post Reply