Detect correct orientation?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
stuporglue
Posts: 6
Joined: 2011-10-19T20:15:50-07:00
Authentication code: 8675308

Detect correct orientation?

Post by stuporglue »

Hello,

Long time IM user, first time on the forums.

I am scanning several thousand (5-7,000) family photos, and I'm wishing there were a way to detect the correct orientation of the scanned image.

Does IM have any features which would be help me automatically rotate these photos?

Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Detect correct orientation?

Post by fmw42 »

Are you talking about just landscape vs portrait or arbitrary rotation? Please clarify or provide a link to an example image.

For the first case, though I have never used this and don't know exactly what it does, which may depend upon some information in the meta data, but check out -orient.

http://www.imagemagick.org/script/comma ... php#orient

For the latter, see -deskew at http://www.imagemagick.org/script/comma ... php#deskew

or if on Linux or Mac or Windows w/cygwin, see my script, unrotate, at the link below.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Detect correct orientation?

Post by anthony »

See Photo Handling, Orientation
http://www.imagemagick.org/Usage/photos/#orient

Especially note that if you are not modifying JPEG photos (only fixing orientation) then jhead may be better!

WARNING: Backup all your original photos FIRST!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply