summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrochner <drochner@pkgsrc.org>2011-01-12 18:46:35 +0000
committerdrochner <drochner@pkgsrc.org>2011-01-12 18:46:35 +0000
commitc7c57fe4185fc7c17d663ce9f4ce29e21e0f344c (patch)
tree1f021b575bda840646d11458ab6b2215ac19ce6b
parent37de98bc3982a41c9b6cde608778588c609f99d6 (diff)
downloadpkgsrc-c7c57fe4185fc7c17d663ce9f4ce29e21e0f344c.tar.gz
update to 0.3.0
changes: -bugfixes -adaption to exiv2-0.21 API
-rw-r--r--graphics/libgexiv2/Makefile7
-rw-r--r--graphics/libgexiv2/distinfo13
-rw-r--r--graphics/libgexiv2/patches/patch-ab28
-rw-r--r--graphics/libgexiv2/patches/patch-ac114
-rw-r--r--graphics/libgexiv2/patches/patch-ad97
-rw-r--r--graphics/libgexiv2/patches/patch-ae314
-rw-r--r--graphics/libgexiv2/patches/patch-af101
7 files changed, 7 insertions, 667 deletions
diff --git a/graphics/libgexiv2/Makefile b/graphics/libgexiv2/Makefile
index 296fabe87a7..7be48c3844f 100644
--- a/graphics/libgexiv2/Makefile
+++ b/graphics/libgexiv2/Makefile
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2010/12/03 20:34:32 adam Exp $
+# $NetBSD: Makefile,v 1.5 2011/01/12 18:46:35 drochner Exp $
-DISTNAME= libgexiv2-0.2.1
-PKGREVISION= 2
+DISTNAME= libgexiv2-0.3.0
CATEGORIES= graphics devel
-MASTER_SITES= http://yorba.org/download/gexiv2/0.2/
+MASTER_SITES= http://yorba.org/download/gexiv2/0.3/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgsrc-users@NetBSD.org
diff --git a/graphics/libgexiv2/distinfo b/graphics/libgexiv2/distinfo
index cc1dce4da73..1380d9061e4 100644
--- a/graphics/libgexiv2/distinfo
+++ b/graphics/libgexiv2/distinfo
@@ -1,11 +1,6 @@
-$NetBSD: distinfo,v 1.3 2010/12/03 20:34:32 adam Exp $
+$NetBSD: distinfo,v 1.4 2011/01/12 18:46:35 drochner Exp $
-SHA1 (libgexiv2-0.2.1.tar.bz2) = b7ab9c35ed221dc18ab4493c51b7b9aac936867f
-RMD160 (libgexiv2-0.2.1.tar.bz2) = 4882c83a2646c3dc8f4ac0a885e76129f1ddc3b9
-Size (libgexiv2-0.2.1.tar.bz2) = 24419 bytes
+SHA1 (libgexiv2-0.3.0.tar.bz2) = bf1186d480078cc87020db7d9f24f20b1e73a171
+RMD160 (libgexiv2-0.3.0.tar.bz2) = 8ed2bebde484e42cab349f244f8c3615112c74d6
+Size (libgexiv2-0.3.0.tar.bz2) = 24172 bytes
SHA1 (patch-aa) = 4a58e9aea1bac3115dba86f787246e361433e954
-SHA1 (patch-ab) = ca9410af7f72437c01700b36e55cf775ca2f5dfd
-SHA1 (patch-ac) = 3726a716816b298068ef415cbb2faffd790d14af
-SHA1 (patch-ad) = 38ed4a1e65b044351035b29ed4181ebf00e0f74a
-SHA1 (patch-ae) = 35c6142e56e6f7adf3363e18aba8598f76aad521
-SHA1 (patch-af) = 73fceb18939594054531fffd0fe1e7599fd5b308
diff --git a/graphics/libgexiv2/patches/patch-ab b/graphics/libgexiv2/patches/patch-ab
deleted file mode 100644
index b8a03de9ed9..00000000000
--- a/graphics/libgexiv2/patches/patch-ab
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-ab,v 1.1 2010/12/03 16:51:04 drochner Exp $
-
---- gexiv2/gexiv2-metadata-gps.cpp.orig 2010-09-10 21:52:54.000000000 +0000
-+++ gexiv2/gexiv2-metadata-gps.cpp
-@@ -28,7 +28,6 @@ gboolean gexiv2_metadata_get_gps_longitu
- *longitude = 0.0;
-
- gchar* longitude_ref = gexiv2_metadata_get_exif_tag_string (self, "Exif.GPSInfo.GPSLongitudeRef");
--
- if (longitude_ref == NULL || longitude_ref[0] == '\0')
- return FALSE;
-
-@@ -90,7 +89,6 @@ gboolean gexiv2_metadata_get_gps_latitud
- *latitude = 0.0;
-
- gchar* latitude_ref = gexiv2_metadata_get_exif_tag_string (self, "Exif.GPSInfo.GPSLatitudeRef");
--
- if (latitude_ref == NULL || latitude_ref[0] == '\0')
- return FALSE;
-
-@@ -152,7 +150,6 @@ gboolean gexiv2_metadata_get_gps_altitud
- *altitude = 0.0;
-
- gchar* altitude_ref = gexiv2_metadata_get_exif_tag_string (self, "Exif.GPSInfo.GPSAltitudeRef");
--
- if (altitude_ref == NULL || altitude_ref[0] == '\0')
- return FALSE;
-
diff --git a/graphics/libgexiv2/patches/patch-ac b/graphics/libgexiv2/patches/patch-ac
deleted file mode 100644
index 99687737ca3..00000000000
--- a/graphics/libgexiv2/patches/patch-ac
+++ /dev/null
@@ -1,114 +0,0 @@
-$NetBSD: patch-ac,v 1.2 2010/12/03 20:34:32 adam Exp $
-
---- gexiv2/gexiv2-metadata-exif.cpp.orig 2010-09-10 21:52:54.000000000 +0000
-+++ gexiv2/gexiv2-metadata-exif.cpp
-@@ -20,7 +20,7 @@ gboolean gexiv2_metadata_has_exif (GExiv
- g_return_val_if_fail (GEXIV2_IS_METADATA (self), FALSE);
- g_return_val_if_fail(self->priv->image.get() != NULL, FALSE);
-
-- return ! (self->priv->image->exifData().empty ());
-+ return ! (self->priv->image->exifData().empty());
- }
-
- gboolean gexiv2_metadata_has_exif_tag(GExiv2Metadata *self, const gchar* tag) {
-@@ -29,10 +29,9 @@ gboolean gexiv2_metadata_has_exif_tag(GE
- g_return_val_if_fail(self->priv->image.get() != NULL, FALSE);
-
- Exiv2::ExifData &exif_data = self->priv->image->exifData();
--
- for (Exiv2::ExifData::iterator it = exif_data.begin(); it != exif_data.end(); ++it) {
-- if (g_ascii_strcasecmp(tag, it->key().c_str()) == 0)
-- return true;
-+ if (it->count() > 0 && g_ascii_strcasecmp(tag, it->key().c_str()) == 0)
-+ return TRUE;
- }
-
- return FALSE;
-@@ -49,7 +48,7 @@ gboolean gexiv2_metadata_clear_exif_tag(
-
- Exiv2::ExifData::iterator it = exif_data.begin();
- while (it != exif_data.end()) {
-- if (g_ascii_strcasecmp(tag, it->key().c_str()) == 0) {
-+ if (it->count() > 0 && g_ascii_strcasecmp(tag, it->key().c_str()) == 0) {
- it = exif_data.erase(it);
- erased = true;
- } else {
-@@ -81,8 +80,10 @@ gchar** gexiv2_metadata_get_exif_tags (G
- gint count = 0;
-
- for (Exiv2::ExifData::iterator it = exif_data.begin(); it != exif_data.end(); ++it) {
-- list = g_slist_prepend (list, g_strdup (it->key ().c_str ()));
-- count++;
-+ if (it->count() > 0) {
-+ list = g_slist_prepend (list, g_strdup (it->key ().c_str ()));
-+ count++;
-+ }
- }
-
- data = g_new (gchar*, count + 1);
-@@ -104,7 +105,10 @@ gchar* gexiv2_metadata_get_exif_tag_stri
-
- try {
- Exiv2::ExifData::iterator it = exif_data.findKey(Exiv2::ExifKey(tag));
-- if (it != exif_data.end ())
-+ while (it != exif_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != exif_data.end())
- return g_strdup (it->toString ().c_str ());
- } catch (Exiv2::Error& e) {
- LOG_ERROR(e);
-@@ -122,7 +126,10 @@ gchar* gexiv2_metadata_get_exif_tag_inte
-
- try {
- Exiv2::ExifData::iterator it = exif_data.findKey(Exiv2::ExifKey(tag));
-- if (it != exif_data.end ()) {
-+ while (it != exif_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != exif_data.end()) {
- std::ostringstream os;
- it->write (os);
-
-@@ -161,7 +168,10 @@ glong gexiv2_metadata_get_exif_tag_long
-
- try {
- Exiv2::ExifData::iterator it = exif_data.findKey(Exiv2::ExifKey(tag));
-- if (it != exif_data.end ())
-+ while (it != exif_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != exif_data.end())
- return it->toLong ();
- } catch (Exiv2::Error& e) {
- LOG_ERROR(e);
-@@ -198,7 +208,10 @@ gboolean gexiv2_metadata_get_exif_tag_ra
-
- try {
- Exiv2::ExifData::iterator it = exif_data.findKey(Exiv2::ExifKey(tag));
-- if (it != exif_data.end ()) {
-+ while (it != exif_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != exif_data.end()) {
- Exiv2::Rational r = it->toRational();
- *nom = r.first;
- *den = r.second;
-@@ -238,7 +251,7 @@ const gchar* gexiv2_metadata_get_exif_ta
- Exiv2::ExifKey key(tag);
-
- try {
-- return Exiv2::ExifTags::tagLabel (key.tag (), key.ifdId ());
-+ return key.tagLabel().c_str();
- } catch (Exiv2::Error& e) {
- LOG_ERROR(e);
- }
-@@ -252,7 +265,7 @@ const gchar* gexiv2_metadata_get_exif_ta
- Exiv2::ExifKey key(tag);
-
- try {
-- return Exiv2::ExifTags::tagDesc (key.tag (), key.ifdId ());
-+ return key.tagDesc().c_str();
- } catch (Exiv2::Error& e) {
- LOG_ERROR(e);
- }
diff --git a/graphics/libgexiv2/patches/patch-ad b/graphics/libgexiv2/patches/patch-ad
deleted file mode 100644
index 1915fb96545..00000000000
--- a/graphics/libgexiv2/patches/patch-ad
+++ /dev/null
@@ -1,97 +0,0 @@
-$NetBSD: patch-ad,v 1.1 2010/12/03 16:51:04 drochner Exp $
-
---- gexiv2/gexiv2-metadata-iptc.cpp.orig 2010-09-10 21:52:54.000000000 +0000
-+++ gexiv2/gexiv2-metadata-iptc.cpp
-@@ -23,7 +23,7 @@ gboolean gexiv2_metadata_has_iptc (GExiv
- g_return_val_if_fail(GEXIV2_IS_METADATA (self), FALSE);
- g_return_val_if_fail(self->priv->image.get() != NULL, FALSE);
-
-- return ! (self->priv->image->iptcData().empty ());
-+ return ! (self->priv->image->iptcData().empty());
- }
-
- gboolean gexiv2_metadata_has_iptc_tag(GExiv2Metadata *self, const gchar* tag) {
-@@ -34,7 +34,7 @@ gboolean gexiv2_metadata_has_iptc_tag(GE
- Exiv2::IptcData &iptc_data = self->priv->image->iptcData();
-
- for (Exiv2::IptcData::iterator it = iptc_data.begin(); it != iptc_data.end(); ++it) {
-- if (g_ascii_strcasecmp(tag, it->key().c_str()) == 0)
-+ if (it->count() > 0 && g_ascii_strcasecmp(tag, it->key().c_str()) == 0)
- return true;
- }
-
-@@ -52,7 +52,7 @@ gboolean gexiv2_metadata_clear_iptc_tag(
-
- Exiv2::IptcData::iterator it = iptc_data.begin();
- while (it != iptc_data.end()) {
-- if (g_ascii_strcasecmp(tag, it->key().c_str()) == 0) {
-+ if (it->count() > 0 && g_ascii_strcasecmp(tag, it->key().c_str()) == 0) {
- it = iptc_data.erase(it);
- erased = true;
- } else {
-@@ -84,8 +84,10 @@ gchar** gexiv2_metadata_get_iptc_tags (G
- gint count = 0;
-
- for (Exiv2::IptcData::iterator it = iptc_data.begin(); it != iptc_data.end(); ++it) {
-- list = g_slist_prepend (list, g_strdup (it->key ().c_str ()));
-- count = count + 1;
-+ if (it->count() > 0) {
-+ list = g_slist_prepend (list, g_strdup (it->key ().c_str ()));
-+ count++;
-+ }
- }
-
- data = g_new (gchar*, count + 1);
-@@ -98,7 +100,6 @@ gchar** gexiv2_metadata_get_iptc_tags (G
- return data;
- }
-
--
- gchar* gexiv2_metadata_get_iptc_tag_string (GExiv2Metadata *self, const gchar* tag) {
- g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
- g_return_val_if_fail(tag != NULL, NULL);
-@@ -108,7 +109,10 @@ gchar* gexiv2_metadata_get_iptc_tag_stri
-
- try {
- Exiv2::IptcData::iterator it = iptc_data.findKey(Exiv2::IptcKey(tag));
-- if (it != iptc_data.end ())
-+ while (it != iptc_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != iptc_data.end())
- return g_strdup (it->toString ().c_str ());
- } catch (Exiv2::Error& e) {
- LOG_ERROR(e);
-@@ -126,7 +130,10 @@ gchar* gexiv2_metadata_get_iptc_tag_inte
-
- try {
- Exiv2::IptcData::iterator it = iptc_data.findKey(Exiv2::IptcKey(tag));
-- if (it != iptc_data.end ()) {
-+ while (it != iptc_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != iptc_data.end()) {
- std::ostringstream os;
- it->write (os);
-
-@@ -172,9 +179,9 @@ gchar** gexiv2_metadata_get_iptc_tag_mul
- try {
- Exiv2::IptcKey key (tag);
- for (Exiv2::IptcData::iterator it = iptc_data.begin(); it != iptc_data.end(); ++it) {
-- if (key.key () == it->key ()) {
-+ if (it->count() > 0 && key.key () == it->key ()) {
- list = g_slist_prepend (list, g_strdup (it->toString ().c_str ()));
-- count ++;
-+ count++;
- }
- }
-
-@@ -207,7 +214,7 @@ gboolean gexiv2_metadata_set_iptc_tag_mu
- Exiv2::IptcKey iptc_key(tag);
- Exiv2::IptcData::iterator iptc_it = iptc_data.begin();
- while (iptc_it != iptc_data.end()) {
-- if (iptc_key.key () == iptc_it->key ())
-+ if (iptc_it->count() > 0 && iptc_key.key () == iptc_it->key ())
- iptc_it = iptc_data.erase (iptc_it);
- else
- ++iptc_it;
diff --git a/graphics/libgexiv2/patches/patch-ae b/graphics/libgexiv2/patches/patch-ae
deleted file mode 100644
index afd388485b3..00000000000
--- a/graphics/libgexiv2/patches/patch-ae
+++ /dev/null
@@ -1,314 +0,0 @@
-$NetBSD: patch-ae,v 1.1 2010/12/03 16:51:04 drochner Exp $
-
---- gexiv2/gexiv2-metadata.cpp.orig 2010-09-10 21:52:54.000000000 +0000
-+++ gexiv2/gexiv2-metadata.cpp
-@@ -380,62 +380,51 @@ gchar* gexiv2_metadata_get_date_time (GE
- g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
- g_return_val_if_fail(self->priv->image.get() != NULL, NULL);
-
-- Exiv2::ExifData& exif_data = self->priv->image->exifData();
--
-- if (!exif_data.empty ()) {
-- Exiv2::ExifKey key ("Exif.Photo.DateTimeOriginal");
-- Exiv2::ExifData::iterator it = exif_data.findKey (key);
-- if (it != exif_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::ExifKey ("Exif.Image.DateTime");
-- it = exif_data.findKey (key);
-- if (it != exif_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::ExifKey ("Exif.Photo.DateTimeDigitized");
-- it = exif_data.findKey (key);
-- if (it != exif_data.end ())
-- return g_strdup (it->toString ().c_str ());
-+ if (gexiv2_metadata_has_exif(self)) {
-+ gchar *datetime = gexiv2_metadata_get_exif_tag_interpreted_string(self,
-+ "Exif.Photo.DateTimeOriginal");;
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_exif_tag_interpreted_string(self, "Exif.Image.DateTime");
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_exif_tag_interpreted_string(self,
-+ "Exif.Image.DateTimeDigitized");
-+ if (datetime != NULL)
-+ return datetime;
- }
-
-- Exiv2::XmpData& xmp_data = self->priv->image->xmpData();
--
-- if (!xmp_data.empty ()) {
-- Exiv2::XmpKey key ("Xmp.exif.DateTimeOriginal");
-- Exiv2::XmpData::iterator it = xmp_data.findKey (key);
-- if (it != xmp_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::XmpKey ("Xmp.xmp.CreateDate");
-- it = xmp_data.findKey (key);
-- if (it != xmp_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::XmpKey ("Xmp.exif.DateTimeDigitized");
-- it = xmp_data.findKey (key);
-- if (it != xmp_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::XmpKey ("Xmp.tiff.DateTime");
-- it = xmp_data.findKey (key);
-- if (it != xmp_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::XmpKey ("Xmp.photoshop.DateCreated");
-- it = xmp_data.findKey (key);
-- if (it != xmp_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::XmpKey ("Xmp.xmp.ModifyDate");
-- it = xmp_data.findKey (key);
-- if (it != xmp_data.end ())
-- return g_strdup (it->toString ().c_str ());
--
-- key = Exiv2::XmpKey ("Xmp.xmp.MetadataDate");
-- it = xmp_data.findKey (key);
-- if (it != xmp_data.end ())
-- return g_strdup (it->toString ().c_str ());
-+ if (gexiv2_metadata_has_xmp(self)) {
-+ gchar *datetime = gexiv2_metadata_get_xmp_tag_interpreted_string(self,
-+ "Xmp.exif.DateTimeOriginal");
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_xmp_tag_interpreted_string(self, "Xmp.xmp.CreateDate");
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_xmp_tag_interpreted_string(self, "Xmp.exif.DateTimeDigitized");
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_xmp_tag_interpreted_string(self, "Xmp.tiff.DateTime");
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_xmp_tag_interpreted_string(self, "Xmp.photoshop.DateCreated");
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_xmp_tag_interpreted_string(self, "Xmp.xmp.ModifyDate");
-+ if (datetime != NULL)
-+ return datetime;
-+
-+ datetime = gexiv2_metadata_get_xmp_tag_interpreted_string(self, "Xmp.xmp.MetadataDate");
-+ if (datetime != NULL)
-+ return datetime;
- }
-
- /* FIXME: handle IPTC Date */
-@@ -471,76 +460,43 @@ GExiv2Orientation gexiv2_metadata_get_or
- g_return_val_if_fail(GEXIV2_IS_METADATA (self), GEXIV2_ORIENTATION_UNSPECIFIED);
- g_return_val_if_fail(self->priv->image.get() != NULL, GEXIV2_ORIENTATION_UNSPECIFIED);
-
-- Exiv2::ExifData& exif_data = self->priv->image->exifData();
--
-- if (!exif_data.empty ()) {
-- /* Because some camera set a wrong standard exif orientation tag,
-- We need to check makernote tags first!
-- */
-- Exiv2::ExifKey minolta_key1 ("Exif.MinoltaCs7D.Rotation");
-- Exiv2::ExifData::iterator it = exif_data.findKey (minolta_key1);
-- if (it != exif_data.end ()) {
-- switch (it->toLong ()) {
-+ if (gexiv2_metadata_has_exif(self)) {
-+ // Because some camera set a wrong standard exif orientation tag,
-+ // We need to check makernote tags first!
-+ if (gexiv2_metadata_has_exif_tag(self, "Exif.MinoltaCs7D.Rotation")) {
-+ switch (gexiv2_metadata_get_exif_tag_long(self, "Exif.MinoltaCs7D.Rotation")) {
- case 76:
- return GEXIV2_ORIENTATION_ROT_90;
-+
- case 82:
- return GEXIV2_ORIENTATION_ROT_270;
-- default:
-- return GEXIV2_ORIENTATION_NORMAL;
- }
- }
-
-- Exiv2::ExifKey minolta_key2 ("Exif.MinoltaCs5D.Rotation");
-- it = exif_data.findKey (minolta_key2);
-- if (it != exif_data.end ()) {
-- switch (it->toLong ()) {
-+ if (gexiv2_metadata_has_exif_tag(self, "Exif.MinoltaCs5D.Rotation")) {
-+ switch (gexiv2_metadata_get_exif_tag_long(self, "Exif.MinoltaCs5D.Rotation")) {
- case 76:
- return GEXIV2_ORIENTATION_ROT_90;
-+
- case 82:
- return GEXIV2_ORIENTATION_ROT_270;
-- default:
-- return GEXIV2_ORIENTATION_NORMAL;
- }
- }
--
-- Exiv2::ExifKey std_key ("Exif.Image.Orientation");
-- it = exif_data.findKey (std_key);
-
-- // TODO: This was added in response to http://trac.yorba.org/ticket/2514
-- // The user supplied a file to us with two Exif.Image.Orientation fields, one reported (the
-- // first) as zero by exiv2. I discovered that field has a count() of zero, or is emtpy,
-- // which causes a segfault when the iterator is dereferenced.
-- //
-- // This searches for the first matching non-empty key. A better solution would be to guard
-- // against this in all searches for all domains, but that's too much of a change for now.
-- // We'll probably need to do this for the next release.
-- while (it != exif_data.end() && it->count() == 0)
-- it++;
--
-- if (it != exif_data.end ()) {
-- GExiv2Orientation orientation = (GExiv2Orientation) it->toLong ();
--
-- return ((orientation < GEXIV2_ORIENTATION_MIN ||
-- orientation > GEXIV2_ORIENTATION_MAX) ?
-- GEXIV2_ORIENTATION_UNSPECIFIED : orientation);
-- }
-+ GExiv2Orientation orientation = (GExiv2Orientation) gexiv2_metadata_get_exif_tag_long(self,
-+ "Exif.Image.Orientation");
-+ if (orientation >= GEXIV2_ORIENTATION_MIN && orientation <= GEXIV2_ORIENTATION_MAX)
-+ return orientation;
- }
-
-- Exiv2::XmpData& xmp_data = self->priv->image->xmpData();
--
-- if (!xmp_data.empty ()) {
-- Exiv2::XmpKey tiff_width_key ("Xmp.tiff.ImageWidth");
-- Exiv2::XmpData::iterator it = xmp_data.findKey (tiff_width_key);
-- if (it != xmp_data.end ()) {
-- GExiv2Orientation orientation = (GExiv2Orientation) it->toLong ();
--
-- return ((orientation < GEXIV2_ORIENTATION_MIN ||
-- orientation > GEXIV2_ORIENTATION_MAX) ?
-- GEXIV2_ORIENTATION_UNSPECIFIED : orientation);
-- }
-+ GExiv2Orientation orientation = GEXIV2_ORIENTATION_UNSPECIFIED;
-+ if (gexiv2_metadata_has_xmp_tag(self, "Xmp.tiff.ImageWidth")) {
-+ orientation = (GExiv2Orientation) gexiv2_metadata_get_xmp_tag_long(self,
-+ "Xmp.tiff.ImageWidth");
- }
-
-- return GEXIV2_ORIENTATION_UNSPECIFIED;
-+ return (orientation < GEXIV2_ORIENTATION_MIN || orientation > GEXIV2_ORIENTATION_MAX)
-+ ? GEXIV2_ORIENTATION_UNSPECIFIED : orientation;
- }
-
- gboolean gexiv2_metadata_get_supports_exif (GExiv2Metadata *self) {
-@@ -576,15 +532,8 @@ void gexiv2_metadata_set_orientation (GE
- exif_data["Exif.Image.Orientation"] = static_cast<uint16_t> (orientation);
- xmp_data["Xmp.tiff.ImageWidth"] = static_cast<uint16_t> (orientation);
-
-- Exiv2::ExifKey minolta_key1 ("Exif.MinoltaCs7D.Rotation");
-- Exiv2::ExifData::iterator it = exif_data.findKey (minolta_key1);
-- if (it != exif_data.end ())
-- exif_data.erase (it);
--
-- Exiv2::ExifKey minolta_key2 ("Exif.MinoltaCs5D.Rotation");
-- it = exif_data.findKey (minolta_key2);
-- if (it != exif_data.end ())
-- exif_data.erase (it);
-+ gexiv2_metadata_clear_exif_tag(self, "Exif.MinoltaCs7D.Rotation");
-+ gexiv2_metadata_clear_exif_tag(self, "Exif.MinoltaCs5D.Rotation");
- }
-
- gint gexiv2_metadata_get_pixel_width (GExiv2Metadata *self) {
-@@ -605,32 +554,20 @@ gint gexiv2_metadata_get_metadata_pixel_
- g_return_val_if_fail (GEXIV2_IS_METADATA (self), -1);
- g_return_val_if_fail(self->priv->image.get() != NULL, -1);
-
-- Exiv2::ExifData& exif_data = self->priv->image->exifData();
--
-- if (!exif_data.empty ()) {
-- Exiv2::ExifKey pixel_dim_key ("Exif.Photo.PixelXDimension");
-- Exiv2::ExifData::iterator it = exif_data.findKey (pixel_dim_key);
-- if (it != exif_data.end ())
-- return it->toLong ();
--
-- Exiv2::ExifKey image_width_key ("Exif.Image.ImageWidth");
-- it = exif_data.findKey (image_width_key);
-- if (it != exif_data.end ())
-- return it->toLong ();
-+ if (gexiv2_metadata_has_exif(self)) {
-+ if (gexiv2_metadata_has_exif_tag(self, "Exif.Photo.PixelXDimension"))
-+ return gexiv2_metadata_get_exif_tag_long(self, "Exif.Photo.PixelXDimension");
-+
-+ if (gexiv2_metadata_has_exif_tag(self, "Exif.Image.ImageWidth"))
-+ return gexiv2_metadata_get_exif_tag_long(self, "Exif.Image.ImageWidth");
- }
-
-- Exiv2::XmpData& xmp_data = self->priv->image->xmpData();
--
-- if (!exif_data.empty ()) {
-- Exiv2::XmpKey tiff_width_key ("Xmp.tiff.ImageWidth");
-- Exiv2::XmpData::iterator it = xmp_data.findKey (tiff_width_key);
-- if (it != xmp_data.end ())
-- return it->toLong ();
--
-- Exiv2::XmpKey xmp_exif_key ("Xmp.exif.PixelXDimension");
-- it = xmp_data.findKey (xmp_exif_key);
-- if (it != xmp_data.end ())
-- return it->toLong ();
-+ if (gexiv2_metadata_has_xmp(self)) {
-+ if (gexiv2_metadata_has_xmp_tag(self, "Xmp.tiff.ImageWidth"))
-+ return gexiv2_metadata_get_xmp_tag_long(self, "Xmp.tiff.ImageWidth");
-+
-+ if (gexiv2_metadata_has_xmp_tag(self, "Xmp.exif.PixelXDimension"))
-+ return gexiv2_metadata_get_xmp_tag_long(self, "Xmp.exif.PixelXDimension");
- }
-
- return -1;
-@@ -640,32 +577,20 @@ gint gexiv2_metadata_get_metadata_pixel_
- g_return_val_if_fail (GEXIV2_IS_METADATA (self), -1);
- g_return_val_if_fail(self->priv->image.get() != NULL, -1);
-
-- Exiv2::ExifData& exif_data = self->priv->image->exifData();
--
-- if (!exif_data.empty ()) {
-- Exiv2::ExifKey pixel_dim_key ("Exif.Photo.PixelYDimension");
-- Exiv2::ExifData::iterator it = exif_data.findKey (pixel_dim_key);
-- if (it != exif_data.end ())
-- return it->toLong ();
--
-- Exiv2::ExifKey image_height_key ("Exif.Image.ImageHeight");
-- it = exif_data.findKey (image_height_key);
-- if (it != exif_data.end ())
-- return it->toLong ();
-+ if (gexiv2_metadata_has_exif(self)) {
-+ if (gexiv2_metadata_has_exif_tag(self, "Exif.Photo.PixelYDimension"))
-+ return gexiv2_metadata_get_exif_tag_long(self, "Exif.Photo.PixelYDimension");
-+
-+ if (gexiv2_metadata_has_exif_tag(self, "Exif.Image.ImageHeight"))
-+ return gexiv2_metadata_get_exif_tag_long(self, "Exif.Image.ImageHeight");
- }
-
-- Exiv2::XmpData& xmp_data = self->priv->image->xmpData();
--
-- if (!exif_data.empty ()) {
-- Exiv2::XmpKey tiff_height_key ("Xmp.tiff.ImageHeight");
-- Exiv2::XmpData::iterator it = xmp_data.findKey (tiff_height_key);
-- if (it != xmp_data.end ())
-- return it->toLong ();
--
-- Exiv2::XmpKey xmp_exif_key ("Xmp.exif.PixelYDimension");
-- it = xmp_data.findKey (xmp_exif_key);
-- if (it != xmp_data.end ())
-- return it->toLong ();
-+ if (gexiv2_metadata_has_xmp(self)) {
-+ if (gexiv2_metadata_has_xmp_tag(self, "Xmp.tiff.ImageHeight"))
-+ return gexiv2_metadata_get_xmp_tag_long(self, "Xmp.tiff.ImageHeight");
-+
-+ if (gexiv2_metadata_has_xmp_tag(self, "Xmp.exif.PixelYDimension"))
-+ return gexiv2_metadata_get_xmp_tag_long(self, "Xmp.exif.PixelYDimension");
- }
-
- return -1;
diff --git a/graphics/libgexiv2/patches/patch-af b/graphics/libgexiv2/patches/patch-af
deleted file mode 100644
index 58aa25d706d..00000000000
--- a/graphics/libgexiv2/patches/patch-af
+++ /dev/null
@@ -1,101 +0,0 @@
-$NetBSD: patch-af,v 1.1 2010/12/03 16:51:04 drochner Exp $
-
---- gexiv2/gexiv2-metadata-xmp.cpp.orig 2010-09-10 21:52:54.000000000 +0000
-+++ gexiv2/gexiv2-metadata-xmp.cpp
-@@ -51,7 +51,7 @@ gboolean gexiv2_metadata_has_xmp_tag(GEx
- Exiv2::XmpData &xmp_data = self->priv->image->xmpData();
-
- for (Exiv2::XmpData::iterator it = xmp_data.begin(); it != xmp_data.end(); ++it) {
-- if (g_ascii_strcasecmp(tag, it->key().c_str()) == 0)
-+ if (it->count() > 0 && g_ascii_strcasecmp(tag, it->key().c_str()) == 0)
- return true;
- }
-
-@@ -69,7 +69,7 @@ gboolean gexiv2_metadata_clear_xmp_tag(G
-
- Exiv2::XmpData::iterator it = xmp_data.begin();
- while (it != xmp_data.end()) {
-- if (g_ascii_strcasecmp(tag, it->key().c_str()) == 0) {
-+ if (it->count() > 0 && g_ascii_strcasecmp(tag, it->key().c_str()) == 0) {
- it = xmp_data.erase(it);
- erased = true;
- } else {
-@@ -94,8 +94,10 @@ gchar** gexiv2_metadata_get_xmp_tags (GE
- gint count = 0;
-
- for (Exiv2::XmpData::iterator it = xmp_data.begin(); it != xmp_data.end(); ++it) {
-- list = g_slist_prepend (list, g_strdup (it->key ().c_str ()));
-- count = count + 1;
-+ if (it->count() > 0) {
-+ list = g_slist_prepend (list, g_strdup (it->key ().c_str ()));
-+ count++;
-+ }
- }
-
- data = g_new (gchar*, count + 1);
-@@ -116,10 +118,11 @@ gchar* gexiv2_metadata_get_xmp_tag_strin
- Exiv2::XmpData& xmp_data = self->priv->image->xmpData();
-
- try {
--
- Exiv2::XmpData::iterator it = xmp_data.findKey(Exiv2::XmpKey(tag));
-+ while (it != xmp_data.end() && it->count() == 0)
-+ it++;
-
-- if (it != xmp_data.end ())
-+ if (it != xmp_data.end())
- return g_strdup (it->toString ().c_str ());
- } catch (Exiv2::Error& e) {
- LOG_ERROR(e);
-@@ -137,7 +140,10 @@ gchar* gexiv2_metadata_get_xmp_tag_inter
-
- try {
- Exiv2::XmpData::iterator it = xmp_data.findKey(Exiv2::XmpKey(tag));
-- if (it != xmp_data.end ()) {
-+ while (it != xmp_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != xmp_data.end()) {
- std::ostringstream os;
- it->write (os);
-
-@@ -177,7 +183,10 @@ glong gexiv2_metadata_get_xmp_tag_long (
-
- try {
- Exiv2::XmpData::iterator it = xmp_data.findKey(Exiv2::XmpKey(tag));
-- if (it != xmp_data.end ())
-+ while (it != xmp_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != xmp_data.end())
- return it->toLong ();
- } catch (Exiv2::Error& e) {
- LOG_ERROR(e);
-@@ -211,7 +220,10 @@ gchar** gexiv2_metadata_get_xmp_tag_mult
-
- try {
- Exiv2::XmpData::iterator it = xmp_data.findKey(Exiv2::XmpKey(tag));
-- if (it != xmp_data.end ()) {
-+ while (it != xmp_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != xmp_data.end()) {
- int size = it->count ();
- gchar **array = g_new (gchar*, size + 1);
- array[size] = NULL;
-@@ -242,9 +254,12 @@ gboolean gexiv2_metadata_set_xmp_tag_mul
-
- try {
- /* first clear existing tag */
-- Exiv2::XmpData::iterator xmp_it = xmp_data.findKey(Exiv2::XmpKey(tag));
-- if (xmp_it != xmp_data.end ())
-- xmp_data.erase (xmp_it);
-+ Exiv2::XmpData::iterator it = xmp_data.findKey(Exiv2::XmpKey(tag));
-+ while (it != xmp_data.end() && it->count() == 0)
-+ it++;
-+
-+ if (it != xmp_data.end())
-+ xmp_data.erase (it);
-
- /* ... and then set the others */
- const gchar **val_it = values;