Commit e24669a3 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

added the dump_exif_data function

useful to find exiv2 bugs
parent 3dda6555
...@@ -855,6 +855,40 @@ gth_main_get_metadata_type (gpointer metadata, ...@@ -855,6 +855,40 @@ gth_main_get_metadata_type (gpointer metadata,
} }
static void
dump_exif_data (Exiv2::ExifData &exifData,
const char *prefix)
{
std::cout << prefix << "\n";
try {
if (exifData.empty()) {
throw Exiv2::Error(1, " No Exif data found in the file");
}
Exiv2::ExifData::const_iterator end = exifData.end();
for (Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i) {
const char* tn = i->typeName();
std::cout << std::setw(44) << std::setfill(' ') << std::left
<< i->key() << " "
<< "0x" << std::setw(4) << std::setfill('0') << std::right
<< std::hex << i->tag() << " "
<< std::setw(9) << std::setfill(' ') << std::left
<< (tn ? tn : "Unknown") << " "
<< std::dec << std::setw(3)
<< std::setfill(' ') << std::right
<< i->count() << " "
<< std::dec << i->value()
<< "\n";
}
std::cout << "\n";
}
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e.what() << "'\n";
return;
}
}
static Exiv2::DataBuf static Exiv2::DataBuf
exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, exiv2_write_metadata_private (Exiv2::Image::AutoPtr image,
GFileInfo *info, GFileInfo *info,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment