Bug #407

Writing metadata back to image after intrusive change looses thumbnail

Added by Andreas Huggel about 12 years ago. Updated over 8 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Andreas Huggel% Done:

0%

Category:exif
Target version:-

Description

Read Exif data, add a tag (or make any other "intrusive change", write data back. The resulting Exif data has a corrupt JPEGInterchangeFormat offset.

The problem arises because
void addToIfd(Ifd& ifd, const Exifdatum& md, ByteOrder byteOrder)
writes the original absolute offset to the new Ifd entry and in
Entry::setDataAreaOffsets
it is assumed to be an offset relative to the start of the data.

Additional information:

Simple reproducer:

#include "exif.hpp"
int main(int argc, char* const argv[]) {
if (argc != 2) {
std::cout << "Usage: " << argv0 << " file\n";
return 1;
}
Exiv2::ExifData exifData;
exifData.read(argv1);
exifData["Exif.GPSInfo.GPSAltitude"] = Exiv2::URational(400, 1);
exifData.write(argv1);
return rc;
}

History

#1 Updated by Andreas Huggel about 12 years ago

Rel. 474

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux