#55 Incorrect maker notes offsets

open
nobody
libexif (61)
5
2006-09-20
2006-09-20
C. Jeffery Small
No

I am using a development build of gimp that uses
version 0.6.13 of libexif. I am working with jpeg
files from a Konica-Minolta 7D camera. When gimp saves
a jpeg file there is a problem with the exif data. I
discovered this problem using Phil Harvey's exiftool
program. When it tries to parse the metadata it reports:

Warning: [minor] Possibly incorrect maker notes offsets
(fix by -94?)

or

Warning: [minor] Possibly incorrect maker notes offsets
(fix by -16?)

The offset difference seems to be related to landscape
vs. portrait orientation.

I wrote to Phil about this and here was his reply:

-------------------------------
The problem is that any software that rewrites the EXIF
and changes the position of the maker note information
must also change any absolute offsets inside the maker
notes or else they will point to invalid data. (The
maker notes frequently contain a TIFF IFD structure,
and unfortunately the TIFF standard specifies that all
offsets are absolute. There are, however, some smart
manufacturers like FujiFilm who ignore this standard
and use relative offsets instead, and these relative
offsets are not invalidated when the maker note block
changes location, but most others like Canon, Nikon,
Pentax, etc use absolute offsets.)

This is a very common problem because the maker notes
contain proprietary information and not many utilities
are able to properly shift the offsets when editing the
EXIF. The EXIF editor must at least understand the IFD
structure of the maker notes in order to properly
adjust the offsets when the information is moved.
-------------------------------

I was not seeing this problem with an earlier version
of gimp. I'm not sure just when libexif might have
been changed (I use gimp packages from blastwave.org
and don't build it myself), but I assume that this
library must be responsible for all exif data
manipulation in the jpeg files, so I am reporting this
here. Can this be investigated and hopefully fixed.
By the way, this is a minor problem as exiftool simply
goes ahead and fixes the offset problem every time it
edits the metadata. However, it is annoying to see
this warning message each time a file operated on by
gimp is examined.

I am attaching a small file that can be used to
investigate the problem. This was saved from gimp
2.3.11. If you have a copy of exiftool you can run:

exiftool -g2 z1.jpg

to see the putput including the warning. If you are on
a Solaris system, you can get a packaged version of
exiftool, maintained by me, at blastwave.org.

Discussion

  • Test jpeg that has the maker notes offset problem.

     
    Attachments
  • Joakim Larsson
    Joakim Larsson
    2007-02-15

    Logged In: YES
    user_id=1720585
    Originator: NO

    I have observed this problem in gthumb 2.9.1 too that is using libexif 0.6.13. The problem varies between camera makers and I also see that the size decreases when saving. 2 bytes less for Minolta pictures like the attached one and 1297 bytes for Nikon pictures. I filed a bug with gthumb for this where you can get the example files for Nikon aswell:

    http://bugzilla.gnome.org/show_bug.cgi?id=408185

    // Joakim