GNOME Bugzilla – Bug 634234
Image rotation results in broken EXIF Orientation and Resolution tags
Last modified: 2010-11-09 09:33:00 UTC
When gThumb physically rotates images (including auto-rotation on camera import), the resulting image has broken EXIF tags for Orientation and [XY]Resolution: $ jhead -v 2010_11_07-14_24_33.jpg Exif header 4282 bytes long Exif section in Intel order (dir has 16 entries) Make = "Canon" Model = "Canon DIGITAL IXUS 80 IS" Orientation = 0 Orientation = 1 Orientation = 1 Nonfatal Error : '2010_11_07-14_24_33.jpg' More than two orientation in Exif Orientation = 1 Nonfatal Error : '2010_11_07-14_24_33.jpg' More than two orientation in Exif XResolution = 0/327962 XResolution = 180/1 XResolution = 180/1 XResolution = 180/1 YResolution = 180/1 ResolutionUnit = 2 Software = "gthumb 2.11.3" DateTime = "2010:11:07 14:24:33" [...] This (apparently) results in Shotwell segfaulting on import of such images, and perl Image::Info complaining about invalid RATIONAL value for XResolution. Example image attached. System is Ubuntu Maverick on AMD64.
Created attachment 174005 [details] image with broken tags after rotation Cut 10k from the beginning of the jpeg because bugzilla refused to upload the whole file
gThumb 2.11.3 was an unstable development release. Many bugs have been fixed since then. Please try again with stable 2.12.0, and re-open this bug if it still occurs with 2.12.0. You can get 2.12.0 for Ubuntu here: http://www.webupd8.org/2010/09/gthumb-2120-stable-has-been-released.html - Mike
gthumb: Installed: 3:2.12.0-1~webupd8~maverick does not rotate the images on import at all (crashes after copying but before rotation). gthumb: tiffcomposite.cpp:1141: virtual uint32_t Exiv2::Internal::TiffDirectory::doWrite(Exiv2::Internal::IoWrapper&, Exiv2::ByteOrder, int32_t, uint32_t, uint32_t, uint32_t&): Assertion `sv == d' failed. Aborted The images are left with reset orientation, as they are shown in wrong orientation and are not automatically rotated afterwords by other programs.
Is the "EXIF, IPTC, XMP support" extension enabled in Edit>Extensions?
Yes, on both occasions.
Could you supply a sample image (before rotation) that causes problems when you rotate it by pressing "]"? What version of exiv2 do you have? - Mike
exiv2: Installed: 0.19-3
Created attachment 174090 [details] Header of an image before rotation $ jhead -v IMG_8644.JPG|head -20 Exif header 8190 bytes long Exif section in Intel order (dir has 9 entries) Make = "Canon" Model = "Canon DIGITAL IXUS 80 IS" Orientation = 1 XResolution = 180/1 YResolution = 180/1 ResolutionUnit = 2 DateTime = "2010:11:08 22:35:54" YCbCrPositioning = 1 ExifOffset = 196 Exif Dir:(dir has 32 entries) ExposureTime = 1/60 FNumber = 28/10 ISOSpeedRatings = 125 ExifVersion = "0220" DateTimeOriginal = "2010:11:08 22:35:54" DateTimeDigitized = "2010:11:08 22:35:54" ComponentsConfiguration = "?"
Created attachment 174091 [details] Header of an image after rotation $ jhead -v IMG_8644.JPG|head -20 Exif header 3642 bytes long Exif section in Intel order (dir has 12 entries) Make = "Canon" Model = "Canon DIGITAL IXUS 80 IS" Orientation = 0 Orientation = 1 XResolution = 0/327962 XResolution = 180/1 YResolution = 180/1 ResolutionUnit = 2 Software = "gthumb 2.11.3" DateTime = "2010:11:08 22:35:54" YCbCrPositioning = 1 ExifOffset = 240 Exif Dir:(dir has 32 entries) ExposureTime = 1/60 FNumber = 28/10 ISOSpeedRatings = 125 ExifVersion = "0220"
Full original image is here: http://i.imgur.com/XDOBq.jpg (unless imgur has processed it - I do not know if it does)
Yes, imgur stripped out the metadata. Can you email it to me: mjc@avtechpulse.com? - Mike
Sent; plus the (guaranteed) unmodified image staight from the SD card is here: http://www.average.org/tmp/IMG_8644.JPG
Hmm, works for me on 2.12.0, with exiv2-0.20-1.fc14.x86_64. jhead output after rotation is below. I can't reproduce the problem here. - Mike After rotation: [mjc@xena oscope]$ jhead -v IMG_8644.JPG JFIF SOI marker: Units: 0 (aspect ratio) X-density=1 Y-density=1 Exif header 2958 bytes long Exif section in Intel order (dir has 10 entries) Make = "Canon" Model = "Canon DIGITAL IXUS 80 IS" Orientation = 1 XResolution = 180/1 YResolution = 180/1 ResolutionUnit = 2 Software = "gthumb 2.12.0" DateTime = "2010:11:08 22:35:54" etc, etc.
Upgrading exiv2 to 0.20 *and* gthumb to 2.12 solves the problem (upgrading any single one of these packages does not!) For the record: exiv2: Installed: 0.20-2 gthumb: Installed: 3:2.12.0-1~webupd8~maverick I am OK if you mark it resolved. Thanks for your help!