From: matthieu c. <cas...@fr...> - 2008-06-15 17:25:11
|
Lutz Müller wrote: > On Sat, 2008-06-14 at 19:58 +0200, matthieu castet wrote: >> I need to change exif usercomment. I update the exif tools to do that. >> See the attached patch for cvs. > > I checked in a slightly modified version (for exemple: avoid checking > for e->data 2 times). Ok, thanks. But now it always resize the user comment tag and my patch avoid that by using 0 padding. > >> I don't manage to build cvs > > Have you tried autoreconf -vis? No, will try. > >> all the exif data are rewritten and are different from >> the original picture. >> This shouldn't happen because I only update usercomment without changing >> the tag size. > > libexif doesn't modify in place. It loads/saves all EXIF data. By > default, after loading the EXIF data, libexif makes sure that the EXIF > data follows the specification (EXIF_DATA_OPTION_FOLLOW_SPECIFICATION). > If the EXIF data you get is different from the EXIF data you supplied > (with regard to the content), check if the EXIF data supplied follows > the specification. Have a look at the debug messages using the -d > command line option. Using my patch (usercomment tag size not changed), the difference with -d is [1]. exiv2 also report difference for ExifTag(0x8769) and InteroperabilityTag(0xa005). May be libexif when rewriting the tags remove some padding ? [1] --- /tmp/1 2008-06-15 18:32:44.000000000 +0200 +++ /tmp/2 2008-06-15 18:32:40.000000000 +0200 @@ -1,5 +1,5 @@ ExifLoader: Scanning 1024 byte(s) of data... -ExifData: Parsing 11262 byte(s) EXIF data... +ExifData: Parsing 8931 byte(s) EXIF data... ExifData: Found EXIF header. ExifData: Found EXIF header. @@ -50,13 +50,13 @@ ExifData: Loading entry 0xa403 ('WhiteBalance')... ExifData: Loading entry 0xa404 ('DigitalZoomRatio')... ExifData: Loading entry 0xa406 ('SceneCaptureType')... -ExifData: IFD 1 at 3158. +ExifData: IFD 1 at 3136. ExifData: Loading 6 entries... ExifData: Loading entry 0x103 ('Compression')... ExifData: Loading entry 0x11a ('XResolution')... ExifData: Loading entry 0x11b ('YResolution')... ExifData: Loading entry 0x128 ('ResolutionUnit')... -EXIF tags in '/tmp/IMG_0872.JPG' ('Intel' byte order): +EXIF tags in '/tmp/IMG_0872.JPG.modified.jpeg' ('Intel' byte order): --------------------+---------------------------------------------------------- Tag |Value --------------------+---------------------------------------------------------- @@ -86,8 +86,8 @@ Metering Mode |Pattern Flash |Flash did not fire, compulsory flash mode. Focal Length |8.3 mm -Maker Note |2138 bytes unknown data -User Comment |Marseille : Cath +Maker Note |2124 bytes unknown data +User Comment |mct FlashPixVersion |FlashPix Version 1.0 Color Space |sRGB PixelXDimension |2592 |