Project

General

Profile

Bug #530

Exifdatum::setValue(std::string) sets type of Exif.Image.ImageDescription to "string"

Added by Jan Kundr about 14 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Category:
exif
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When accessing ExifData via operator[](std::string("Exif.Image.ImageDescription")) and assigning a std::string to it, the tag's type is set to "string" while documentation says it should be asciiString.

exiv2 then complains about that upon image load:

Warning: IFD0 tag 0x010e has invalid Exif type 11; using 7 (undefined).


Files

IMG_0215.JPG (229 KB) IMG_0215.JPG Redmine Admin, 13 Oct 2007 11:18

History

#1

Updated by Andreas Huggel about 14 years ago

I can only reproduce the problem if the tag already has a string value before the assignment. If the tag doesn't exist the following program gives the expected result.

What's the Exif data of the image before you assign the string and can you provide a small reproducer?

#include "image.hpp"
#include "exif.hpp"
#include <iostream>
#include <cassert>

int main(int argc, char* const argv[])
try {
if (argc != 2) {
std::cout << "Usage: " << argv0 << " file\n";
return 1;
}

Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(argv[1]);
assert(image.get() != 0);
image->readMetadata();
Exiv2::ExifData &exifData = image->exifData();
std::string v = "What type of string?";
exifData["Exif.Image.ImageDescription"] = v;
image->writeMetadata();
return 0;
}
catch (Exiv2::AnyError& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n";
return -1;
}
#2

Updated by Jan Kundr about 14 years ago

Unfortunately this report is a forward of a bugreport that a user of
KPhotoAlbum sent us. I'm not sure if he still has the original version
of that picture, but I'll ask him to comment here.

#3

Updated by Martin Jost about 14 years ago

I'm the original reporter for the KPA-problem, Jan mentions in his comment.
I've tested again (using JAlbum 7.2.1 with exiv2-0.15 installed).
This time I got NO error from JAlbum.

BUT exiv2 still complains about the photo:

exiv2 -V

exiv2 0.15

exiv2 -v -pic IMG_0215.JPG

Datei 1/1: IMG_0215.JPG
Warning: IFD0 tag 0x010e has invalid Exif type 11; using 7 (undefined).
Warning: IFD0 tag 0x010e has invalid Exif type 11; using 7 (undefined).
Iptc.Application2.Headline String 8 IMG_0215
Iptc.Application2.Caption String 0
Iptc.Application2.Keywords String 18 Gelegenheit/Urlaub
Iptc.Application2.Keywords String 7 getaggt
Iptc.Application2.Keywords String 10 historisch
Iptc.Application2.LocationName String 37 Deutschland/Nordrhein-Westfalen/K

#4

Updated by Andreas Huggel about 14 years ago

The offending tags are:

ahuggel@mowgli> exiv2 -pv IMG_0215.JPG
Warning: IFD0 tag 0x010e has invalid Exif type 11; using 7 (undefined).
Warning: IFD0 tag 0x010e has invalid Exif type 11; using 7 (undefined).
Warning: IFD0 tag 0x010e has invalid Exif type 11; using 7 (undefined).
0x010e Image ImageDescription String 8 Geb

#5

Updated by Andreas Huggel almost 14 years ago

Please reopen with more info to recreate the problem if it still occurs.

Also available in: Atom PDF