Bug #396

Exif makernote corruption (win32 only)

Added by Brad Schick about 13 years ago. Updated almost 9 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Brad Schick% Done:

0%

Category:exif
Target version:0.6

Description

When setting the "Exif.Image.ImageDescription" on the attached image I noticed that makernote data gets corrupted.

Results of "exiv2 print -pt simple.jpg | grep -a Makernote" before running attached code:

0x0000 Makernote 0x0000 0 0 0 0 0 0
0x0000 Makernote 0x0000 0 0 0 0
0x0001 Makernote CameraSettings1
0x0002 Makernote 0x0002 2 682 286 215
0x0003 Makernote 0x0003 0 0 0 0
0x0004 Makernote CameraSettings2
0x0006 Makernote ImageType IMG:PowerShot S40 JPEG
0x0007 Makernote FirmwareVersion Firmware Version 1.00
0x0008 Makernote ImageNumber 106-0698
0x0009 Makernote OwnerName
0x000d Makernote 0x000d 42 3 207 211 217 0 0 0 356 0 0 10 0 2 10 21 331 6 0 0 0
0x0010 Makernote 0x0010 17891328

Results of "exiv2 print -pt simple.jpg | grep -a Makernote" after running attached code:

0x0000 Makernote 0x0000 1072 0 16 4 1 0
0x0000 Makernote 0x0000 0 273 0 0
0x0001 Makernote CameraSettings1
0x0002 Makernote 0x0002 0 0 0 0
0x0003 Makernote 0x0003 65535 49 2272 2272
0x0004 Makernote CameraSettings2
0x0006 Makernote ImageType ☺ ╚∟

simple.jpg (2.26 MB) Redmine Admin, 09 Nov 2004 23:33

test.cpp Magnifier (1.08 KB) Redmine Admin, 09 Nov 2004 23:33

History

#1 Updated by Brad Schick about 13 years ago

Arg, some of the exif characters and spacing got html-ized by mantis. There are actually non-ascii characters in the corrupted output.

#2 Updated by Brad Schick about 13 years ago

I tried this on Linux with GCC 3.3.4 and everything worked fine. Seems to be either a Windows or msvc problem.

#3 Updated by Andreas Huggel about 13 years ago

The test application needs to be linked with mn.o to make sure that MakerNote subclasses are registered in the MakerNote registry. This will make sure that the library recognizes the Canon Makernote and adjusts the IFD offsets when re-locating the Makernote tag within the Exif data.
If the library doesn't know the format of a Makernote it will simply move it without any changes (in this case without updating the IFD offsets). This corrupts MakerNotes in IFD format.

#4 Updated by Brad Schick about 13 years ago

Added mn.cpp to all msvc projects.

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux