convert looses EXIF orientation info
Posted: 2009-01-25T09:46:59-07:00
From debian bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512935
User uses the following script to reduce the resolution (and disk space) of
images:
#!/bin/bash
f=$1
convert -auto-orient -quality 88 -resize 1600x1200 $f $f-new
touch -r $f $f-new
ls -l $f $f-new
mv $f-new $f
What happens is "jhead" reports:
grundler <514>jhead IMG_0001.JPG
File name : IMG_0001.JPG
File size : 1584690 bytes
File date : 2009:01:25 00:29:27
Camera make : Canon
Camera model : Canon PowerShot SD850 IS
Date/Time : 2009:01:22 08:55:15
Resolution : 3264 x 2448
Orientation : rotate 90
Flash used : No
.....
After running the above convert line, I get:
grundler <516>jhead IMG_0001.JPG-NEW
File name : IMG_0001.JPG-NEW
File size : 278022 bytes
File date : 2009:01:25 00:30:53
Camera make : Canon
Camera model : Canon PowerShot SD850 IS
Date/Time : 2009:01:22 08:55:15
Resolution : 1600 x 1200
Flash used : No
....
Note orientation is NOT reported. More clear is "-v" output:
grundler <521>jhead -v IMG_0001.JPG-NEW
Exif header 9726 bytes long
Exif section in Intel order
(dir has 9 entries)
Make = "Canon"
Model = "Canon PowerShot SD850 IS"
Orientation = 0
....
The original image reports:
grundler <523>jhead -v IMG_0001.JPG
Exif header 9726 bytes long
Exif section in Intel order
(dir has 9 entries)
Make = "Canon"
Model = "Canon PowerShot SD850 IS"
Orientation = 6
XResolution = 180/1
YResolution = 180/1
ResolutionUnit = 2
DateTime = "2009:01:22 08:55:15"
....
And the image is displayed sideways (gqview won't autorotate it).
I tried without "-auto-rotate" and got the same result.
Regards
User uses the following script to reduce the resolution (and disk space) of
images:
#!/bin/bash
f=$1
convert -auto-orient -quality 88 -resize 1600x1200 $f $f-new
touch -r $f $f-new
ls -l $f $f-new
mv $f-new $f
What happens is "jhead" reports:
grundler <514>jhead IMG_0001.JPG
File name : IMG_0001.JPG
File size : 1584690 bytes
File date : 2009:01:25 00:29:27
Camera make : Canon
Camera model : Canon PowerShot SD850 IS
Date/Time : 2009:01:22 08:55:15
Resolution : 3264 x 2448
Orientation : rotate 90
Flash used : No
.....
After running the above convert line, I get:
grundler <516>jhead IMG_0001.JPG-NEW
File name : IMG_0001.JPG-NEW
File size : 278022 bytes
File date : 2009:01:25 00:30:53
Camera make : Canon
Camera model : Canon PowerShot SD850 IS
Date/Time : 2009:01:22 08:55:15
Resolution : 1600 x 1200
Flash used : No
....
Note orientation is NOT reported. More clear is "-v" output:
grundler <521>jhead -v IMG_0001.JPG-NEW
Exif header 9726 bytes long
Exif section in Intel order
(dir has 9 entries)
Make = "Canon"
Model = "Canon PowerShot SD850 IS"
Orientation = 0
....
The original image reports:
grundler <523>jhead -v IMG_0001.JPG
Exif header 9726 bytes long
Exif section in Intel order
(dir has 9 entries)
Make = "Canon"
Model = "Canon PowerShot SD850 IS"
Orientation = 6
XResolution = 180/1
YResolution = 180/1
ResolutionUnit = 2
DateTime = "2009:01:22 08:55:15"
....
And the image is displayed sideways (gqview won't autorotate it).
I tried without "-auto-rotate" and got the same result.
Regards