[Kde-imaging] [Bug 144604] Rotation causes Exif data corruption

Andreas Huggel ahuggel at gmx.net
Fri Apr 27 07:23:26 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=144604         




------- Additional Comments From ahuggel gmx net  2007-04-27 07:23 -------
The code in #8 :

a) generates the two Exif.Image.ImageWidth/Length tags, which the original bug report said were newly introduced.

b) uses the type of QSize::size() to eventually choose the type of the Exif tag. Convert or cast it to uint32_t to get an Exif LONG type, e.g.,

d->exifMetadata["Exif.Photo.PixelXDimension"] =
    static_cast<uint32_t>(size.width());

That will create a LONG type regardless of the original type (which could also be SHORT)

Converting the value to an std::string and assigning that will use even more magic: If the tag already exists and has a value, it will attempt to read the string assuming it is of the type of the current value. If the tag doesn't exist yet or doesn't have a value yet, it will create a new value with the Exiv2 default type for the tag.

On the other hand, if you prefer less magic, you can create an Exiv2::Value of the type you want and assign that.

-ahu.


More information about the Kde-imaging mailing list