HELP Convert is not copying Exif:Orient tag when resizing.

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
mixersoft
Posts: 6
Joined: 2008-05-08T16:36:10-07:00

HELP Convert is not copying Exif:Orient tag when resizing.

Post by mixersoft »

I'm running this command to resize a JPG to max 640px along the longest dimension and save in a preview folder. The convert works just fine:

Code: Select all

find $TESTFOLDER  -iname *.jpg -exec convert -verbose {} -resize 640x640">" $PREVIEWFOLDER/{} \;
HOWEVER, if I check the exif data using:

Code: Select all

find $TESTFOLDER  -iname *.jpg -exec identify -format "\nFILE:%m:%f %wx%h\n%[EXIF:*]" {} \;
find $PREVIEWFOLDER/$TESTFOLDER  -iname *.jpg -exec identify -format "\nFILE:%m:%f %wx%h\n%[EXIF:*]" {} \;
the original JPG in $TESTFOLDER shows the correct EXIF info, including:

Code: Select all

JPEG:DisneySea 076.jpg 3456x2304          ## original file
...
exif:MeteringMode=5
exif:Model=Canon EOS Kiss Digital N
exif:Orientation=8                                           ## exif orientation is 8 here
exif:ResolutionUnit=2
exif:SceneCaptureType=0
exif:ShutterSpeedValue=522046/65536
exif:WhiteBalance=0
exif:XResolution=72/1
exif:YCbCrPositioning=2
exif:YResolution=72/1
but the resized version in $PREVIEWFOLDER/$TESTFOLDER shows the same EXIF info, except that the orientation has been changed:

Code: Select all

FILE:JPEG:DisneySea 076.jpg 640x427                ## resized file
...
exif:MeteringMode=5
exif:Model=Canon EOS Kiss Digital N
exif:Orientation=0                                           ## exif orientation changed to 0 here
exif:ResolutionUnit=1
exif:SceneCaptureType=0
exif:ShutterSpeedValue=522046/65536
exif:WhiteBalance=0
exif:XResolution=72/1
exif:YCbCrPositioning=2
exif:YResolution=72/1

What is happening?

ubuntu 8.04.1,
imagemagick Version: ImageMagick 6.3.7 02/18/08 Q16
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: HELP Convert is not copying Exif:Orient tag when resizing.

Post by magick »

You need to use the -resample option to update the EXIF resolution information. ImageMagick does not do this automatically. If think other tags should be updated, let us know which ones and what you think their updated values should be. Its possible that your version of ImageMagick has less support for EXIF than more modern versions. The current ImageMagick release is 6.4.3-6.
mixersoft
Posts: 6
Joined: 2008-05-08T16:36:10-07:00

Re: HELP Convert is not copying Exif:Orient tag when resizing.

Post by mixersoft »

magick wrote:You need to use the -resample option to update the EXIF resolution information. ImageMagick does not do this automatically. If think other tags should be updated, let us know which ones and what you think their updated values should be. Its possible that your version of ImageMagick has less support for EXIF than more modern versions. The current ImageMagick release is 6.4.3-6.

Actually, I don't want the tags updated, Iwant to keep the original EXIF data in it's entirety, including the ORIGINAL image size. I just want to make sure the EXIF orientation tag does NOT change -- it was NOT rotated on resizing. The image to be smaller for faster file transfer. I will try to test with the latest version, but i have to see how to install it onto Ubuntu.
Post Reply