Overlapping MakerNotes - any chance to fix?

Started by Archive, May 12, 2010, 08:54:00 AM

Previous topic - Next topic

Archive

[Originally posted by t11 on 2007-02-10 19:12:07-08]

Hi all,

I have some JPEG images with apparently overlapping MakerNotes:

Code:
$ exiftool SANY0549.JPG -filename -warning -a -S
FileName: SANY0549.JPG
Warning: Overlapping MakerNotes values
Warning: [minor] Possibly incorrect maker notes offsets (fix by 34?)
Warning: Bad MakerNotes directory pointer for SanyoThumbnail

I tried the solution described in
http://www.cpanforum.com/threads/3684" target="_blank">this thread, but unfortunately it doesn't work:

Code:
$ exiftool SANY0549.JPG -tagsfromfile @ -makernotes -F
Warning: Overlapping MakerNotes values - SANY0549.JPG
    1 image files updated
$ exiftool SANY0549.JPG -filename -warning -a -S
FileName: SANY0549.JPG
Warning: Overlapping MakerNotes values
Warning: [minor] Possibly incorrect maker notes offsets (fix by -266?)
Warning: Bad MakerNotes directory pointer for SanyoThumbnail

ExifTool modified the offset, but it is still wrong.

Can my files even be repaired, given some data is probably lost due to the overlapping offsets?

This is with exiftool 6.67, the images are from a Sanyo J4 cam.

Thanks,

Thomas

Archive

[Originally posted by exiftool on 2007-02-11 01:23:37-08]

A whole series of Sanyo cameras write really completely whacky
offsets in their maker notes.  I haven't figured out how to handle
this properly.  I will take a look at this as soon as I can and see
if I can come up with a solution.

Archive

[Originally posted by exiftool on 2007-02-12 20:11:38-08]

I think I have a solution.  My strategy is to completely ignore the offsets
in the Sanyo maker notes and assume the values are in the standard
locations.  The patch only applies to values which are larger than 4
bytes (because smaller values don't require an offset pointer), so this only
affects 4 tags: SanyoThumbnail, SpecialMode, DigitalZoom and DataDump.
The patch works for all of these except for the SanyoThumbnail.  As
far as I can tell the SanyoThumbnail data isn't even written in these
images although there is an entry for it in the MakerNotes directory.
So if an image is rewritten (with the -m option), the SanyoThumbnail
entry is simply deleted.

The patch affects all Sanyo J# and S# cameras, and so far I have tested it
on sample images from the J1, J2, J4, S1, S3 and S4 and it seems to do
the job.

I have updated the
https://exiftool.org/Image-ExifTool-6.75.tar.gz" target="_blank">6.75
pre-release with this patch.  It would be good if you could test this
out before the official release later this week.

Thanks.

- Phil

Archive

[Originally posted by t11 on 2007-02-13 14:11:25-08]

Thanks a lot for the quick response.

I am not entirely sure where the patch comes into play, should I still do the
Code:
exiftool a.jpg -tagsfromfile @ -makernotes -F
, now with the -m flag?

I tried it with and without -m on a file.  The offset error is not displayed anymore with the new exiftools version, but the old one still reports it (note the exiftool invocations with and without the ./):
Code:
$ ./exiftool -filename -warning -a -S test.jpg
FileName: test.jpg
Warning: Bad MakerNotes directory pointer for SanyoThumbnail

$ exiftool -filename -warning -a -S test.jpg
FileName: test.jpg
Warning: Overlapping MakerNotes values
Warning: [minor] Possibly incorrect maker notes offsets (fix by 34?)
Warning: Bad MakerNotes directory pointer for SanyoThumbnail

$ ./exiftool -tagsfromfile @ -makernotes -F -m test.jpg
Warning: Bad MakerNotes directory pointer for SanyoThumbnail - test.jpg
    1 image files updated

$ ./exiftool -filename -warning -a -S test.jpg
FileName: test.jpg
Warning: Bad MakerNotes directory pointer for SanyoThumbnail

$ exiftool -filename -warning -a -S test.jpg
FileName: test.jpg
Warning: Overlapping MakerNotes values
Warning: [minor] Possibly incorrect maker notes offsets (fix by -266?)
Warning: Bad MakerNotes directory pointer for SanyoThumbnail

Thomas

Archive

[Originally posted by exiftool on 2007-02-13 15:21:27-08]

Hi Thomas,

Thanks for pointing this out.

I had only changed the behaviour when writing normally, not when
copying the maker notes.  So rewriting the file with something like
"-ifd0:xresolution=72 -m" would issue a warning, but fix the file
permanently.

But you are right, I should have also applied this fix when copying the
maker notes (ie. "-tagsfromfile @ -makernotes").

I have just added this ability and updated the
https://exiftool.org/Image-ExifTool-6.75.tar.gz" target="_blank">6.75
pre-release with this new feature.

With this version, a warning is issued and the problematic SanyoThumbnail
tag is deleted when the makernotes are copied (the -F or -m options are not
required).  FYI: I did further analysis of these files, and the SanyoThumbnail
data definitely doesn't exist -- these cameras all write an entry in the
makernotes for a fixed-size 10313-byte thumbnail image, but the
data is nowhere to be found.

- Phil

Archive

[Originally posted by t11 on 2007-02-13 15:47:23-08]

Works like a charm!

Thank you very much.

Thomas