From nobody Sun Jul 02 19:49:59 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QvKQb6jK3z4m2mw; Sun, 2 Jul 2023 19:49:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QvKQb6XBmz3NfN; Sun, 2 Jul 2023 19:49:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688327399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxGPJ/iCATGoCBABC4iTqlW1w8MXZGKH6d13AUXlL8c=; b=BMXpxIEsesizyitmOfL6lOb+WAcU+OCCTC+stV1lzb4OEtMcL4Sh8Hlmdv7I2jY9A4uzjq hOIOJ9ZPsgK7IVg3l5cH+lS1jCNRFo//dxT6YoUtt4B5CVvyMBwjbCRlbqgI2n+w1uA7XE bilUujLKbVWP3z3CkdpsZNN2NeSMx/qBE++KxbOzXtQFmfE6nB8oTceKkMyM9TlAYYPdTy JhyFArQyKHAu72JhOFMLvaJFXPhwzYUWbeyEelGwd80QcKDW6OQnJSxy5yN7AmWpJZ0b3M rnIL2VdiDKN6RmddSc8fEMs3EI2tbaISj+JKFdx0rbWafHxbAr2Tp2BE9B2kVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688327399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxGPJ/iCATGoCBABC4iTqlW1w8MXZGKH6d13AUXlL8c=; b=ygfbJJ7d7EOnlxfMhLzaJapKvTJkX+Uh/60zMAHmS5sbhDDdGS85FHqhhn+govIiXKnRcW OhXh9wnYY0+WtTA2zehS4QJoj2KGYCE/Hpv6WjB4Mkz3YqqbcWkcg2NPDA7QGU3PQ0iUdj uz+9lbv30C/C7v+mSSefinZ+OPIP1Xpshn9C1NBI8LemtFQNKttdMmn8Z9yl3xxU8NBsVu iHigcs1AinAcBQ/+Uj7vtlqcG8F+5WKZdNKCmvQ9GetUUFQWCS8SpA0jk8Zt9Vi842265/ gStZgauX4WOdO7ecasxXlhCPfTPjOgZpkG6eAsHWG9BmgZt2WIPgHVjWg85FMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688327399; a=rsa-sha256; cv=none; b=wGu1F8PcQ9NsN6xGNXr/JOdV9NvQAc9wz5y1dBqUrDzuxUjp1I2dq/ewdQ+O0AZB7I170O YT0M8bWRFA5TYRNyI+9h5N8Y0B1pucIA59RPQTgAnuz0kbZz9No3q5bd0eltN8WZOf8SCu tAwYM/WA3iheg5xA99iWhz2x9D0BgTjeUPDxNECHBpbh6dU3YwTK0oYk7bLhmgf6gv0ta2 o/fMJm7KdbGDnd5iouge1tXNhaJy6AY+2BN8d6V5VMQgEXz063AtefPvUMv2OOCvHRDbgA XFsP1XdHzRHTvqFVzDFXN6EWV1P9V6zVCHKoxjpy54yC4oJ582xdVR4SoMoM4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QvKQb5b7bzLCs; Sun, 2 Jul 2023 19:49:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 362JnxAF083773; Sun, 2 Jul 2023 19:49:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 362JnxMx083772; Sun, 2 Jul 2023 19:49:59 GMT (envelope-from git) Date: Sun, 2 Jul 2023 19:49:59 GMT Message-Id: <202307021949.362JnxMx083772@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: 8f2c42142d37 - main - graphics/gexiv2: prepare for exiv2 0.28 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f2c42142d37933e4e12eafa520386b740c2a7ba Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=8f2c42142d37933e4e12eafa520386b740c2a7ba commit 8f2c42142d37933e4e12eafa520386b740c2a7ba Author: Christoph Moench-Tegeder AuthorDate: 2023-07-02 19:48:34 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2023-07-02 19:48:34 +0000 graphics/gexiv2: prepare for exiv2 0.28 PR: 272311 Reported by: mandree@ --- graphics/gexiv2/Makefile | 5 +- graphics/gexiv2/files/patch-06adc8fb70cb | 1296 ++++++++++++++++++++++++++++++ 2 files changed, 1298 insertions(+), 3 deletions(-) diff --git a/graphics/gexiv2/Makefile b/graphics/gexiv2/Makefile index 1c7cb0f7cdd5..6265b02a3d70 100644 --- a/graphics/gexiv2/Makefile +++ b/graphics/gexiv2/Makefile @@ -1,5 +1,6 @@ PORTNAME= gexiv2 PORTVERSION= 0.14.1 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= GNOME @@ -11,7 +12,7 @@ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gobject3>=0:devel/py-gobject3@${PY_FLAVOR} -LIB_DEPENDS= libexiv2.so:graphics/exiv2 +LIB_DEPENDS= libexiv2.so:graphics/exiv2 RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gobject3>=0:devel/py-gobject3@${PY_FLAVOR} USES= compiler:c++17-lang gnome libtool:build meson pathfix pkgconfig \ @@ -29,8 +30,6 @@ OPTIONS_SUB= yes DOCS_BUILD_DEPENDS= gtkdoc-scan:textproc/gtk-doc DOCS_CONFIGURE_ON= -Dgtk_doc=true -.include - pre-install: @${MKDIR} ${STAGEDIR}${PREFIX}/share/vala/vapi diff --git a/graphics/gexiv2/files/patch-06adc8fb70cb b/graphics/gexiv2/files/patch-06adc8fb70cb new file mode 100644 index 000000000000..b2a077346864 --- /dev/null +++ b/graphics/gexiv2/files/patch-06adc8fb70cb @@ -0,0 +1,1296 @@ +commit 06adc8fb70cb8c77c0cd364195d8251811106ef8 +Author: Jens Georg +Date: Sat May 6 10:47:32 2023 +0000 + + Fix compatibility with exiv2 main branch + +diff --git .gitlab-ci.yml .gitlab-ci.yml +index 8684b48..427e5ea 100644 +--- .gitlab-ci.yml ++++ .gitlab-ci.yml +@@ -3,10 +3,11 @@ + - flatpak + variables: + MANIFEST_PATH: "build-aux/org.gnome.GExiv2.json" +- image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:44 ++ image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-44 + stage: build + only: + - schedules ++ - merge_requests + script: + - flatpak-builder build-dir ${MANIFEST_PATH} --stop-at=gexiv2 --user --disable-rofiles-fuse + - flatpak build build-dir meson _build -Dtests=true +diff --git gexiv2/gexiv2-metadata-exif.cpp gexiv2/gexiv2-metadata-exif.cpp +index 1e62292..15237f9 100644 +--- gexiv2/gexiv2-metadata-exif.cpp ++++ gexiv2/gexiv2-metadata-exif.cpp +@@ -8,6 +8,8 @@ + * SPDX-License-Identifier: GPL-2.0-or-later + */ + ++#include ++ + #include "gexiv2-metadata.h" + #include "gexiv2-metadata-private.h" + #include +@@ -116,7 +118,7 @@ gchar* gexiv2_metadata_get_exif_tag_string (GExiv2Metadata *self, const gchar* t + if (it != exif_data.end()) + return g_strdup (it->toString ().c_str ()); + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -146,7 +148,7 @@ gchar** gexiv2_metadata_get_exif_tag_multiple(GExiv2Metadata* self, const gchar* + return array; + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + array = g_new(gchar*, 1); +@@ -187,7 +189,7 @@ gboolean gexiv2_metadata_set_exif_tag_multiple(GExiv2Metadata* self, + } + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -214,7 +216,7 @@ gchar* gexiv2_metadata_get_exif_tag_interpreted_string (GExiv2Metadata *self, co + return g_strdup (os.str ().c_str ()); + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -232,7 +234,7 @@ gboolean gexiv2_metadata_set_exif_tag_string (GExiv2Metadata *self, const gchar* + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -251,11 +253,15 @@ glong gexiv2_metadata_get_exif_tag_long (GExiv2Metadata *self, const gchar* tag, + Exiv2::ExifData::iterator it = exif_data.findKey(Exiv2::ExifKey(tag)); + while (it != exif_data.end() && it->count() == 0) + it++; +- ++#ifdef EXIV2_EXIFDATUM_HAS_TO_LONG + if (it != exif_data.end()) + return it->toLong (); ++#else ++ if (it != exif_data.end()) ++ return static_cast(it->toInt64()); ++#endif + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return 0; +@@ -272,7 +278,7 @@ gboolean gexiv2_metadata_set_exif_tag_long (GExiv2Metadata *self, const gchar* t + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -303,7 +309,7 @@ gboolean gexiv2_metadata_try_get_exif_tag_rational (GExiv2Metadata *self, const + return TRUE; + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -324,7 +330,7 @@ gboolean gexiv2_metadata_try_set_exif_tag_rational (GExiv2Metadata *self, const + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -413,7 +419,7 @@ const gchar* gexiv2_metadata_get_exif_tag_label (const gchar* tag, GError **erro + Exiv2::ExifKey key(tag); + return g_intern_string(key.tagLabel().c_str()); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -427,7 +433,7 @@ const gchar* gexiv2_metadata_get_exif_tag_description (const gchar* tag, GError + Exiv2::ExifKey key(tag); + return g_intern_string(key.tagDesc().c_str()); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -441,7 +447,7 @@ const gchar* gexiv2_metadata_get_exif_tag_type (const gchar* tag, GError **error + Exiv2::ExifKey key(tag); + return Exiv2::TypeInfo::typeName(key.defaultTypeId()); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -455,7 +461,7 @@ gboolean gexiv2_metadata_exif_tag_supports_multiple_values (const gchar* tag, GE + // Exif does not support multiple values, but still check if @tag is valid + const Exiv2::ExifKey key(tag); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -484,7 +490,7 @@ GBytes* gexiv2_metadata_get_exif_tag_raw (GExiv2Metadata *self, const gchar* tag + } + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string ("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -522,7 +528,7 @@ GBytes * gexiv2_metadata_get_exif_data (GExiv2Metadata *self, + + return g_bytes_new_take (data, blob.size()); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +diff --git gexiv2/gexiv2-metadata-gps.cpp gexiv2/gexiv2-metadata-gps.cpp +index 815eb96..7cd7c6c 100644 +--- gexiv2/gexiv2-metadata-gps.cpp ++++ gexiv2/gexiv2-metadata-gps.cpp +@@ -90,7 +90,7 @@ gboolean gexiv2_metadata_try_get_gps_longitude (GExiv2Metadata *self, gdouble *l + + return TRUE; + } catch (Exiv2::Error &e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } catch (std::invalid_argument &e) { + g_set_error_literal(error, g_quark_from_string("GExiv2"), 0, e.what()); + } +@@ -141,7 +141,7 @@ gboolean gexiv2_metadata_try_get_gps_latitude (GExiv2Metadata *self, gdouble *la + + return TRUE; + } catch (Exiv2::Error &e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } catch (std::invalid_argument &e) { + g_set_error_literal(error, g_quark_from_string("GExiv2"), 0, e.what()); + } +@@ -181,7 +181,7 @@ gboolean gexiv2_metadata_try_get_gps_altitude (GExiv2Metadata *self, gdouble *al + + return TRUE; + } catch (Exiv2::Error &e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } catch (std::invalid_argument &e) { + g_set_error_literal(error, g_quark_from_string("GExiv2"), 0, e.what()); + } +@@ -300,7 +300,7 @@ gboolean gexiv2_metadata_try_set_gps_info (GExiv2Metadata *self, gdouble longitu + + return gexiv2_metadata_try_update_gps_info (self, longitude, latitude, altitude, error); + } catch (Exiv2::Error &e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -393,7 +393,7 @@ gboolean gexiv2_metadata_try_update_gps_info (GExiv2Metadata *self, gdouble long + + return TRUE; + } catch (Exiv2::Error &e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -434,7 +434,7 @@ void gexiv2_metadata_try_delete_gps_info (GExiv2Metadata *self, GError **error) + ++exif_it; + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + /* FIXME: two blocks shall ensure to erase in xmp data, if erasing in exif +@@ -454,7 +454,7 @@ void gexiv2_metadata_try_delete_gps_info (GExiv2Metadata *self, GError **error) + + } catch (Exiv2::Error& e) { + if (error && *error == nullptr) +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + } + +diff --git gexiv2/gexiv2-metadata-iptc.cpp gexiv2/gexiv2-metadata-iptc.cpp +index ab675ae..7f34cb4 100644 +--- gexiv2/gexiv2-metadata-iptc.cpp ++++ gexiv2/gexiv2-metadata-iptc.cpp +@@ -140,7 +140,7 @@ gchar* gexiv2_metadata_get_iptc_tag_string (GExiv2Metadata *self, const gchar* t + return g_strdup (os.str().c_str()); + } + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -186,7 +186,7 @@ gchar* gexiv2_metadata_get_iptc_tag_interpreted_string (GExiv2Metadata *self, co + return g_strdup (os.str().c_str()); + } + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -234,7 +234,7 @@ gboolean gexiv2_metadata_set_iptc_tag_string (GExiv2Metadata *self, const gchar* + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -271,7 +271,7 @@ gchar** gexiv2_metadata_get_iptc_tag_multiple (GExiv2Metadata *self, const gchar + + return values; + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + g_slist_free_full (list, g_free); +@@ -347,7 +347,7 @@ gboolean gexiv2_metadata_set_iptc_tag_multiple (GExiv2Metadata *self, const gcha + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -361,7 +361,7 @@ const gchar* gexiv2_metadata_get_iptc_tag_label (const gchar* tag, GError **erro + Exiv2::IptcKey key (tag); + return Exiv2::IptcDataSets::dataSetTitle (key.tag (), key.record ()); + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -375,7 +375,7 @@ const gchar* gexiv2_metadata_get_iptc_tag_description (const gchar* tag, GError + Exiv2::IptcKey key (tag); + return Exiv2::IptcDataSets::dataSetDesc (key.tag (), key.record ()); + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -389,7 +389,7 @@ const gchar* gexiv2_metadata_get_iptc_tag_type (const gchar* tag, GError **error + Exiv2::IptcKey key (tag); + return Exiv2::TypeInfo::typeName(Exiv2::IptcDataSets::dataSetType(key.tag(), key.record())); + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -403,7 +403,7 @@ gboolean gexiv2_metadata_iptc_tag_supports_multiple_values(const gchar* tag, GEr + const Exiv2::IptcKey key(tag); // Check to see if @tag is valid + return (Exiv2::IptcDataSets::dataSetRepeatable(key.tag(), key.record()) ? TRUE : FALSE); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -464,7 +464,7 @@ GBytes* gexiv2_metadata_get_iptc_tag_raw (GExiv2Metadata *self, const gchar* tag + return g_byte_array_free_to_bytes(concatenated_raw_arrays); + } + } catch (Exiv2::Error& e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +diff --git gexiv2/gexiv2-metadata-xmp.cpp gexiv2/gexiv2-metadata-xmp.cpp +index 88c7e2c..6abb61d 100644 +--- gexiv2/gexiv2-metadata-xmp.cpp ++++ gexiv2/gexiv2-metadata-xmp.cpp +@@ -8,6 +8,8 @@ + * SPDX-License-Identifier: GPL-2.0-or-later + */ + ++#include ++ + #include "gexiv2-metadata-private.h" + #include "gexiv2-metadata.h" + +@@ -48,7 +50,7 @@ gchar *gexiv2_metadata_try_generate_xmp_packet(GExiv2Metadata *self, + return g_strdup(packet.c_str()); + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -79,7 +81,7 @@ gchar *gexiv2_metadata_try_get_xmp_packet(GExiv2Metadata *self, GError **error) + try { + return g_strdup(self->priv->image->xmpPacket().c_str()); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -187,7 +189,7 @@ gchar* gexiv2_metadata_get_xmp_tag_string (GExiv2Metadata *self, const gchar* ta + if (it != xmp_data.end()) + return g_strdup (it->toString ().c_str ()); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -214,7 +216,7 @@ gchar* gexiv2_metadata_get_xmp_tag_interpreted_string (GExiv2Metadata *self, con + return g_strdup (os.str ().c_str ()); + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -257,7 +259,7 @@ gboolean gexiv2_metadata_try_set_xmp_tag_struct (GExiv2Metadata *self, const gch + xmp_data.add(Exiv2::XmpKey(tag), &tv); + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -294,7 +296,7 @@ gboolean gexiv2_metadata_set_xmp_tag_string (GExiv2Metadata *self, const gchar* + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -313,11 +315,16 @@ glong gexiv2_metadata_get_xmp_tag_long (GExiv2Metadata *self, const gchar* tag, + Exiv2::XmpData::iterator it = xmp_data.findKey(Exiv2::XmpKey(tag)); + while (it != xmp_data.end() && it->count() == 0) + it++; +- ++ ++#ifdef EXIV2_XMPDATUM_HAS_TO_LONG + if (it != xmp_data.end()) + return it->toLong (); ++#else ++ if (it != xmp_data.end()) ++ return static_cast(it->toInt64()); ++#endif + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return 0; +@@ -334,7 +341,7 @@ gboolean gexiv2_metadata_set_xmp_tag_long (GExiv2Metadata *self, const gchar* ta + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -414,7 +421,7 @@ gchar** gexiv2_metadata_get_xmp_tag_multiple(GExiv2Metadata* self, const gchar* + if (array) { + g_strfreev(array); + } +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + array = g_new(gchar*, 1); +@@ -450,7 +457,7 @@ gchar** gexiv2_metadata_get_xmp_tag_multiple_deprecated (GExiv2Metadata *self, c + return array; + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + gchar **array = g_new (gchar*, 1); +@@ -488,7 +495,7 @@ gboolean gexiv2_metadata_set_xmp_tag_multiple (GExiv2Metadata *self, const gchar + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -501,7 +508,7 @@ const gchar* gexiv2_metadata_get_xmp_tag_label (const gchar* tag, GError **error + try { + return Exiv2::XmpProperties::propertyTitle(Exiv2::XmpKey(tag)); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -514,7 +521,7 @@ const gchar* gexiv2_metadata_get_xmp_tag_description (const gchar* tag, GError * + try { + return Exiv2::XmpProperties::propertyDesc(Exiv2::XmpKey(tag)); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -527,7 +534,7 @@ const gchar* gexiv2_metadata_get_xmp_tag_type (const gchar* tag, GError **error) + try { + return Exiv2::TypeInfo::typeName(Exiv2::XmpProperties::propertyType(Exiv2::XmpKey(tag))); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return NULL; +@@ -569,7 +576,7 @@ gboolean gexiv2_metadata_xmp_tag_supports_multiple_values(GExiv2Metadata* self, + return TRUE; + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + return FALSE; + } +@@ -597,7 +604,7 @@ GBytes* gexiv2_metadata_get_xmp_tag_raw (GExiv2Metadata *self, const gchar* tag, + } + } + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return nullptr; +@@ -622,15 +629,21 @@ gboolean gexiv2_metadata_try_register_xmp_namespace(const gchar* name, const gch + g_return_val_if_fail(prefix != nullptr, FALSE); + g_return_val_if_fail(error == nullptr || *error == nullptr, FALSE); + ++#if defined(EXIV2_HAS_ANY_ERROR) ++ using Exiv2ErrorProxy = Exiv2::AnyError; ++#else ++ using Exiv2ErrorProxy = Exiv2::Error; ++#endif ++ + try { + Exiv2::XmpProperties::ns(prefix); +- } catch (Exiv2::AnyError& e1) { ++ } catch (Exiv2ErrorProxy& e1) { + // No namespace, OK to register + try { + Exiv2::XmpProperties::registerNs(name, prefix); + return TRUE; +- } catch (Exiv2::AnyError& e2) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e2.code(), e2.what()); ++ } catch (Exiv2ErrorProxy& e2) { ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e2.code()), e2.what()); + } + } + +@@ -670,7 +683,7 @@ gboolean gexiv2_metadata_try_unregister_xmp_namespace(const gchar* name, GError* + } + } + } catch (Exiv2::Error& e2) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e2.code(), e2.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e2.code()), e2.what()); + } + return FALSE; + } +@@ -692,7 +705,7 @@ void gexiv2_metadata_try_unregister_all_xmp_namespaces(GError** error) { + try { + Exiv2::XmpProperties::unregisterNs(); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + } + +@@ -739,7 +752,7 @@ char* gexiv2_metadata_try_get_xmp_namespace_for_tag(const char* tag, GError** er + + result = g_strdup(info.c_str()); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + g_clear_pointer(&list, g_strfreev); +diff --git gexiv2/gexiv2-metadata.cpp gexiv2/gexiv2-metadata.cpp +index 928b07b..c67529e 100644 +--- gexiv2/gexiv2-metadata.cpp ++++ gexiv2/gexiv2-metadata.cpp +@@ -9,19 +9,22 @@ + */ + + #include "gexiv2-metadata.h" +-#include "gexiv2-metadata-private.h" +-#include "gexiv2-stream-io.h" ++ ++#include "gexiv2-log-private.h" ++#include "gexiv2-log.h" + #include "gexiv2-managed-stream.h" +-#include "gexiv2-preview-properties.h" +-#include "gexiv2-preview-properties-private.h" +-#include "gexiv2-preview-image.h" ++#include "gexiv2-metadata-private.h" + #include "gexiv2-preview-image-private.h" +-#include "gexiv2-log.h" +-#include "gexiv2-log-private.h" +-#include ++#include "gexiv2-preview-image.h" ++#include "gexiv2-preview-properties-private.h" ++#include "gexiv2-preview-properties.h" ++#include "gexiv2-stream-io.h" ++ + #include +-#include ++#include + #include ++#include ++#include + + #ifdef G_OS_WIN32 + #include +@@ -46,7 +49,7 @@ public: + , _eof{false} + {} + #if EXIV2_TEST_VERSION(0,27,99) +- using size_type = long; ++ using size_type = size_t; + #else + using size_type = long; + #endif +@@ -66,6 +69,9 @@ public: + using ptr_type = Exiv2::BasicIo::AutoPtr; + #endif + ++#if EXIV2_TEST_VERSION(0, 27, 99) ++ void populateFakeData() override{}; ++#endif + int open() override { + if (_seekable == nullptr) + return 0; +@@ -91,9 +97,17 @@ public: + Exiv2::DataBuf read(size_type rcount) override { + Exiv2::DataBuf b{rcount}; + ++#ifdef EXIV2_DATABUF_HAS_PRIVATE_PDATA ++ auto bytes_read = this->read(b.data(), rcount); ++#else + auto bytes_read = this->read(b.pData_, rcount); ++#endif + if (bytes_read > 0 && bytes_read != rcount) { ++#ifdef EXIV2_DATABUF_HAS_PRIVATE_PDATA ++ b = Exiv2::DataBuf{b}; ++#else + b.reset({b.pData_, bytes_read}); ++#endif + } + + return b; +@@ -188,7 +202,7 @@ public: + + int munmap() override { return 0; } + +- long tell() const override { ++ size_type tell() const override { + if (_seekable != nullptr && g_seekable_can_seek (_seekable)) { + return static_cast(g_seekable_tell (_seekable)); + } else { +@@ -204,10 +218,21 @@ public: + + bool eof() const override { return _eof; } + ++#if EXIV2_TEST_VERSION(0, 27, 99) ++ const std::string& path() const noexcept override { ++ static std::string info{"GIO Wrapper"}; ++ return info; ++ } ++#else + std::string path() const override { return "GIO Wrapper"; } ++#endif + + #ifdef EXV_UNICODE_PATH ++#ifdef EXIV2_TEST_VERSION(0, 27, 99) ++ const std::wstring& wpath() const noexcept override { ++#else + std::wstring wpath() const override { ++#endif + std::string p = path(); + std::wstring w(p.length(), L' '); + std::copy(p.begin(), p.end(), w.begin()); +@@ -395,7 +420,7 @@ static void gexiv2_metadata_init_internal(GExiv2Metadata* self, GError** error) + if (priv->preview_manager) + delete priv->preview_manager; + +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + } + +@@ -416,7 +441,7 @@ static gboolean gexiv2_metadata_open_internal (GExiv2Metadata* self, GError** er + + return !(error && *error); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -476,11 +501,11 @@ gboolean gexiv2_metadata_open_path(GExiv2Metadata* self, const gchar* path, GErr + + return gexiv2_metadata_open_internal (self, error); + } catch (Exiv2::Error &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + #ifdef EXV_UNICODE_PATH + catch (Exiv2::WError &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + #endif + +@@ -503,7 +528,7 @@ gboolean gexiv2_metadata_open_buf(GExiv2Metadata* self, const guint8* data, glon + + gboolean gexiv2_metadata_open_stream (GExiv2Metadata *self, ManagedStreamCallbacks* cb, GError **error) { + g_return_val_if_fail (GEXIV2_IS_METADATA (self), FALSE); +- ++ + try { + StreamIo::ptr_type stream_ptr{new StreamIo (cb)}; + #if EXIV2_TEST_VERSION(0,27,99) +@@ -514,7 +539,7 @@ gboolean gexiv2_metadata_open_stream (GExiv2Metadata *self, ManagedStreamCallbac + + return gexiv2_metadata_open_internal (self, error); + } catch (Exiv2::Error &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + + return FALSE; +@@ -533,7 +558,7 @@ gboolean gexiv2_metadata_from_stream(GExiv2Metadata *self, GInputStream *stream, + + return gexiv2_metadata_open_internal (self, error); + } catch (Exiv2::Error &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + + return FALSE; +@@ -584,7 +609,7 @@ gboolean gexiv2_metadata_from_app1_segment(GExiv2Metadata* self, const guint8* d + return TRUE; + } catch (Exiv2::Error &e) { + delete self->priv->image.release(); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + return FALSE; + } +@@ -653,7 +678,7 @@ static gboolean gexiv2_metadata_save_internal (GExiv2Metadata *self, image_ptr i + + return TRUE; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + return FALSE; + } +@@ -675,11 +700,11 @@ gboolean gexiv2_metadata_save_external (GExiv2Metadata *self, const gchar *path, + Exiv2::ImageFactory::create(Exiv2::ImageType::xmp, local_path), + error); + } catch (Exiv2::Error &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + #ifdef EXV_UNICODE_PATH + catch (Exiv2::WError &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + #endif + +@@ -701,11 +726,11 @@ gboolean gexiv2_metadata_save_file (GExiv2Metadata *self, const gchar *path, GEr + + return gexiv2_metadata_save_internal(self, Exiv2::ImageFactory::open(local_path), error); + } catch (Exiv2::Error &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + #ifdef EXV_UNICODE_PATH + catch (Exiv2::WError &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + #endif + +@@ -713,8 +738,8 @@ gboolean gexiv2_metadata_save_file (GExiv2Metadata *self, const gchar *path, GEr + } + + gboolean gexiv2_metadata_save_stream (GExiv2Metadata *self, ManagedStreamCallbacks* cb, GError **error) { +- g_return_val_if_fail (GEXIV2_IS_METADATA (self), FALSE); +- ++ g_return_val_if_fail(GEXIV2_IS_METADATA(self), FALSE); ++ + try { + StreamIo::ptr_type stream_ptr{new StreamIo (cb)}; + +@@ -724,7 +749,7 @@ gboolean gexiv2_metadata_save_stream (GExiv2Metadata *self, ManagedStreamCallbac + return gexiv2_metadata_save_internal (self, Exiv2::ImageFactory::open (stream_ptr), error); + #endif + } catch (Exiv2::Error &e) { +- g_set_error_literal (error, g_quark_from_string ("GExiv2"), e.code (), e.what ()); ++ g_set_error_literal (error, g_quark_from_string ("GExiv2"), static_cast(e.code()), e.what ()); + } + + return FALSE; +@@ -761,7 +786,7 @@ gboolean gexiv2_metadata_try_has_tag(GExiv2Metadata* self, const gchar* tag, GEr + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return FALSE; + } +@@ -797,7 +822,7 @@ gboolean gexiv2_metadata_try_clear_tag(GExiv2Metadata* self, const gchar* tag, G + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return FALSE; + } +@@ -954,7 +979,7 @@ void gexiv2_metadata_try_set_orientation(GExiv2Metadata* self, GExiv2Orientation + gexiv2_metadata_clear_exif_tag(self, "Exif.MinoltaCs7D.Rotation"); + gexiv2_metadata_clear_exif_tag(self, "Exif.MinoltaCs5D.Rotation"); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + } + +@@ -1075,7 +1100,7 @@ void gexiv2_metadata_try_set_metadata_pixel_width(GExiv2Metadata* self, gint wid + xmp_data["Xmp.tiff.ImageWidth"] = static_cast(width); + xmp_data["Xmp.exif.PixelXDimension"] = static_cast(width); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + } + +@@ -1104,7 +1129,7 @@ void gexiv2_metadata_try_set_metadata_pixel_height(GExiv2Metadata* self, gint he + xmp_data["Xmp.tiff.ImageLength"] = static_cast(height); + xmp_data["Xmp.exif.PixelYDimension"] = static_cast(height); + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + } + +@@ -1226,7 +1251,7 @@ void gexiv2_metadata_try_set_comment(GExiv2Metadata* self, const gchar* comment, + /* Do not need to write to acdsee properties, just read from them */ + // xmp_data ["Xmp.acdsee.notes"] = comment; + } catch (Exiv2::Error& e) { +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + } + } + +@@ -1273,7 +1298,7 @@ gchar* gexiv2_metadata_try_get_tag_string (GExiv2Metadata *self, const gchar* ta + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return nullptr; + } +@@ -1295,7 +1320,7 @@ gboolean gexiv2_metadata_try_set_tag_string (GExiv2Metadata *self, const gchar* + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return FALSE; + } +@@ -1353,7 +1378,7 @@ gchar* gexiv2_metadata_try_get_tag_interpreted_string (GExiv2Metadata *self, con + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return nullptr; + } +@@ -1393,7 +1418,7 @@ gchar** gexiv2_metadata_try_get_tag_multiple(GExiv2Metadata *self, const gchar* + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return nullptr; + } +@@ -1416,7 +1441,7 @@ gboolean gexiv2_metadata_try_set_tag_multiple(GExiv2Metadata *self, const gchar* + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return FALSE; + } +@@ -1459,7 +1484,7 @@ gchar** gexiv2_metadata_get_tag_multiple(GExiv2Metadata* self, const gchar* tag) + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(&error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(&error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + g_warning("%s", error->message); + g_clear_error(&error); + +@@ -1499,7 +1524,7 @@ glong gexiv2_metadata_try_get_tag_long(GExiv2Metadata *self, const gchar* tag, G + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return 0; + } +@@ -1536,7 +1561,7 @@ gboolean gexiv2_metadata_try_set_tag_long(GExiv2Metadata *self, const gchar* tag + + // Invalid "familyName" + Exiv2::Error e(Exiv2::ErrorCode::kerInvalidKey, tag); +- g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what()); ++ g_set_error_literal(error, g_quark_from_string("GExiv2"), static_cast(e.code()), e.what()); + + return FALSE; + } +@@ -1691,6 +1716,12 @@ gboolean gexiv2_metadata_get_exif_thumbnail (GExiv2Metadata *self, guint8** buff + g_return_val_if_fail(self->priv->image.get() != nullptr, FALSE); + + Exiv2::ExifThumb thumb = Exiv2::ExifThumb(self->priv->image->exifData()); ++#ifdef EXIV2_DATABUF_HAS_PRIVATE_PDATA ++ auto buf = thumb.copy(); ++ *buffer = reinterpret_cast(g_malloc(buf.size())); ++ std::copy(buf.begin(), buf.end(), *buffer); ++ *size = buf.size(); ++#else + Exiv2::DataBuf data = thumb.copy(); + if (data.pData_ == nullptr) + return FALSE; +@@ -1698,6 +1729,7 @@ gboolean gexiv2_metadata_get_exif_thumbnail (GExiv2Metadata *self, guint8** buff + *buffer = (guint8*) g_malloc(data.size_); + memcpy(*buffer, data.pData_, data.size_); + *size = data.size_; ++#endif *** 363 LINES SKIPPED ***