Bug #407

Writing metadata back to image after intrusive change looses thumbnail

Added by Andreas Huggel about 13 years ago. Updated over 9 years ago.

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


Target version:-


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
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["Exif.GPSInfo.GPSAltitude"] = Exiv2::URational(400, 1);
return rc;


#1 Updated by Andreas Huggel about 13 years ago

Rel. 474

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux