Rotate image if needed, then strip exif metadata

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
coloring
Posts: 82
Joined: 2015-08-27T10:17:36-07:00
Authentication code: 1151

Rotate image if needed, then strip exif metadata

Post by coloring »

I have a collection of photos that I want into thumbnails with the size of 600x400. These are the rules
  • images that are not in 6:4 format must be letterboxed, not stretched
  • vertical images must have lateral letterboxing
  • no exif metadata should be left on the thumbnails (size reasons)
I almost of solved my problem with

Code: Select all

convert "$img" -resize 600x400 -background black -gravity center -extent 600x400 "$dest.jpg"
I now need to strip the exif metadata. But if I do that adding -strip, vertical images will not be displayed correctly any more. I also tried to use -auto-orient -strip, but it does not rotate the images.

How do I tell imagemagick to rotate all the vertical images and then strip all the metadata?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Rotate image if needed, then strip exif metadata

Post by snibgo »

Last time I tried it, "-auto-orient" worked fine. Please post an example where it doesn't.

EDIT: and, of course, tell us which version of IM you are using.
snibgo's IM pages: im.snibgo.com
Post Reply