diff src/exiv2.cc @ 180:e6c8cf017d68

more exiv2 fixes
author nadvornik
date Wed, 13 Feb 2008 17:47:55 +0000
parents 37004d5a584a
children 8a417f10ba09
line wrap: on
line diff
--- a/src/exiv2.cc	Wed Feb 13 17:08:04 2008 +0000
+++ b/src/exiv2.cc	Wed Feb 13 17:47:55 2008 +0000
@@ -52,7 +52,12 @@
 
 gint exif_get_integer(ExifData *exif, const gchar *key, gint *value)
 {
-	return exif->exifData[key].toLong();
+	Exiv2::ExifKey ekey(key);
+	Exiv2::ExifData::iterator pos = exif->exifData.findKey(ekey);
+	if (pos == exif->exifData.end()) return 0;
+	*value = pos->getValue()->toLong();
+	
+	return 1;
 }
 
 ExifRational *exif_get_rational(ExifData *exif, const gchar *key, gint *sign)
@@ -95,12 +100,12 @@
 
 const char *exif_item_get_tag_name(ExifItem *item)
 {
-	return ((Exiv2::Exifdatum *)item)->tagName().c_str();
+	return ((Exiv2::Exifdatum *)item)->key().c_str();
 }
 
 guint exif_item_get_tag_id(ExifItem *item)
 {
-	return ((Exiv2::Exifdatum *)item)->idx();
+	return ((Exiv2::Exifdatum *)item)->tag();
 }
 
 guint exif_item_get_elements(ExifItem *item)
@@ -147,9 +152,7 @@
 }
 const char *exif_item_get_format_name(ExifItem *item, gint brief)
 {
-/*
-	return exif_item_get_tag_name(item);
-*/
+	return ((Exiv2::Exifdatum *)item)->typeName();
 }