changeset 180:e6c8cf017d68

more exiv2 fixes
author nadvornik
date Wed, 13 Feb 2008 17:47:55 +0000
parents 37004d5a584a
children c01dd7c9c7dc
files src/exiv2.cc src/image.c
diffstat 2 files changed, 10 insertions(+), 7 deletions(-) [+]
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();
 }
 
 
--- a/src/image.c	Wed Feb 13 17:08:04 2008 +0000
+++ b/src/image.c	Wed Feb 13 17:47:55 2008 +0000
@@ -432,7 +432,7 @@
 		{
 		gint orientation;
 
-		if (exif_get_integer(exif, "Orientation", &orientation))
+		if (exif_get_integer(exif, "Exif.Image.Orientation", &orientation))
 			{
 			gint rotate = TRUE;