After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 634234 - Image rotation results in broken EXIF Orientation and Resolution tags
Image rotation results in broken EXIF Orientation and Resolution tags
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.11.x
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2010-11-07 18:14 UTC by Eugene Crosser
Modified: 2010-11-09 09:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
image with broken tags after rotation (10.00 KB, application/octet-stream)
2010-11-07 18:21 UTC, Eugene Crosser
Details
Header of an image before rotation (10.00 KB, image/jpeg)
2010-11-08 19:41 UTC, Eugene Crosser
Details
Header of an image after rotation (10.00 KB, image/jpeg)
2010-11-08 19:42 UTC, Eugene Crosser
Details

Description Eugene Crosser 2010-11-07 18:14:18 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.
Comment 1 Eugene Crosser 2010-11-07 18:21:41 UTC
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
Comment 2 Michael Chudobiak 2010-11-07 18:37:33 UTC
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
Comment 3 Eugene Crosser 2010-11-07 19:09:24 UTC
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.
Comment 4 Michael Chudobiak 2010-11-08 12:53:08 UTC
Is the "EXIF, IPTC, XMP support" extension enabled in Edit>Extensions?
Comment 5 Eugene Crosser 2010-11-08 18:47:22 UTC
Yes, on both occasions.
Comment 6 Michael Chudobiak 2010-11-08 19:00:43 UTC
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
Comment 7 Eugene Crosser 2010-11-08 19:31:57 UTC
exiv2:
  Installed: 0.19-3
Comment 8 Eugene Crosser 2010-11-08 19:41:21 UTC
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 = "?"
Comment 9 Eugene Crosser 2010-11-08 19:42:20 UTC
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"
Comment 10 Eugene Crosser 2010-11-08 19:46:05 UTC
Full original image is here: http://i.imgur.com/XDOBq.jpg
(unless imgur has processed it - I do not know if it does)
Comment 11 Michael Chudobiak 2010-11-08 19:49:21 UTC
Yes, imgur stripped out the metadata. Can you email it to me: mjc@avtechpulse.com?

- Mike
Comment 12 Eugene Crosser 2010-11-08 20:00:36 UTC
Sent; plus the (guaranteed) unmodified image staight from the SD card is here:
http://www.average.org/tmp/IMG_8644.JPG
Comment 13 Michael Chudobiak 2010-11-08 20:07:31 UTC
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.
Comment 14 Eugene Crosser 2010-11-09 09:33:00 UTC
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!