From nobody Sun Jul 09 22:09:55 2023 X-Original-To: dev-commits-ports-all@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 4QzhBr1qVJz4mr5F; Sun, 9 Jul 2023 22:09:56 +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 4QzhBr170hz3DP8; Sun, 9 Jul 2023 22:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688940596; 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=oyXpaTsormdO1Ccj7S2WAJFjpFanRawnf0TCUH+sVew=; b=jf7CJCFbwCd6oMPA0uDA+c00c64/FXWxuCfCVXwXD4tsZ+dosBRIC0tiYVvvS6jS7RP5Dd voYsM08LVZTLw8UqsZpDFSPqdpp/UuqYiRTQ6ze425OSEtO7HB1o2mg7cyxmFs3OdwutwK WOYMYHQ+RigfiFDZ6y4uIJ8q5OK2aLNln/vl+BKSZgmjWkUVH4wmkmhdGoWIx5gRKvLBF2 Pn6UIm9fCppnvgnDEGWjPw6pbH/jV90P7f2wgJnKqt5ogNPdcpxkkefcY5lw1vn2+8nK7J ouqQqF0WXz5ZEa+GtJtCDRl9kOEZVN6ApO6B/t8IAJg1+HQzVYGlWtAeiCze+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688940596; 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=oyXpaTsormdO1Ccj7S2WAJFjpFanRawnf0TCUH+sVew=; b=ekHkMJBkImtQ59Y3EEg8Lhkt0rNRsVKBuXWA0ilBG5w3dDGRcZ7eyHiFUSlU/RXithqj0f xe9ZKxru18EP7zlE9o1/HjYI/xDJpjaNuheOhp9ogZXKQCUOSxHLdyD5zEsaXN5EbSTGTw ITg6onEDTjZNFkeFJBKxS/6jsB0Qg+sJKvl+gJJj6ACUfbKTJGkl9E0vsYCBKYmN2JYoVY x3w5gn6anRo4sEnyqApU0+tTfnhQ1RQaCDrNQznedbWncgvsJNNBqm/e68On0IICzp8Ioo QGHC9E/9DpG6LrI1xQEOxUmZah2VBlHezLrPL2WkGzh9EhGEcll/OmpsjW6tFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688940596; a=rsa-sha256; cv=none; b=TX9ObXBCEgIC43OW9aRX2LUg2ZJp3umqgrG0Tevu3XQK47fXOP2kU1/RvKiI5rCAIBl2Jz /RsqUYij7yCx7QvmVEpXSXL/qcIa+/aeadK9SAivt+JyaWhZgMBbU0LJ53UqeAriT6CKFU 1Xt6dzug4PEMNg5QsElMGub3yIf5xRSCago/DD+xYuh3DbnJVIv+kBtg1/SrAVQRWa2c72 otjwtXcz3ORfnsEmGZizXBfDH+42HiC50AJCHoSsj+ClJJWWYH1IT3qkkSon+kc6puAB+h Iwq+O8/QiTGKvFu1+DtHERss9dSzG8OKhqFCn3mVFo7shkbo5zDEpC2pkUr/WA== 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 4QzhBq6qNvzL0b; Sun, 9 Jul 2023 22:09:55 +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 369M9t4i034570; Sun, 9 Jul 2023 22:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 369M9tfF034569; Sun, 9 Jul 2023 22:09:55 GMT (envelope-from git) Date: Sun, 9 Jul 2023 22:09:55 GMT Message-Id: <202307092209.369M9tfF034569@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Matthias Andree Subject: git: 77c434f50324 - main - graphics/gthumb: make compatible with exiv2 0.28 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mandree X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77c434f5032412b13bc6b86ce70e8e62f12f74b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=77c434f5032412b13bc6b86ce70e8e62f12f74b1 commit 77c434f5032412b13bc6b86ce70e8e62f12f74b1 Author: Matthias Andree AuthorDate: 2023-07-03 00:03:41 +0000 Commit: Matthias Andree CommitDate: 2023-07-09 22:09:11 +0000 graphics/gthumb: make compatible with exiv2 0.28 Obtained from: https://gitlab.gnome.org/GNOME/gthumb/-/commit/3376550ae109286de09ce5f89e05060eb80230a7 PR: 272311 --- graphics/gthumb/Makefile | 2 +- ...git-aa-3376550ae109286de09ce5f89e05060eb80230a7 | 375 +++++++++++++++++++++ 2 files changed, 376 insertions(+), 1 deletion(-) diff --git a/graphics/gthumb/Makefile b/graphics/gthumb/Makefile index 94c3c79cd700..9c58c48dcb31 100644 --- a/graphics/gthumb/Makefile +++ b/graphics/gthumb/Makefile @@ -1,6 +1,6 @@ PORTNAME= gthumb PORTVERSION= 3.12.2 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= graphics MASTER_SITES= GNOME DIST_SUBDIR= gnome diff --git a/graphics/gthumb/files/patch-git-aa-3376550ae109286de09ce5f89e05060eb80230a7 b/graphics/gthumb/files/patch-git-aa-3376550ae109286de09ce5f89e05060eb80230a7 new file mode 100644 index 000000000000..e874aa7eeeab --- /dev/null +++ b/graphics/gthumb/files/patch-git-aa-3376550ae109286de09ce5f89e05060eb80230a7 @@ -0,0 +1,375 @@ +From 3376550ae109286de09ce5f89e05060eb80230a7 Mon Sep 17 00:00:00 2001 +From: Paolo Bacchilega +Date: Tue, 27 Jun 2023 18:56:48 +0200 +Subject: [PATCH] exiv2: added support for version 0.28 + +Patch by Alex and Antonio Rojas from the discussion of the issue 282. + +Fixes #282 +--- + extensions/exiv2_tools/exiv2-utils.cpp | 141 +++++++++++++++++++++++++ + 1 file changed, 141 insertions(+) + +diff --git ./extensions/exiv2_tools/exiv2-utils.cpp ./extensions/exiv2_tools/exiv2-utils.cpp +index 56dadb4eb..20f049c2a 100644 +--- ./extensions/exiv2_tools/exiv2-utils.cpp ++++ ./extensions/exiv2_tools/exiv2-utils.cpp +@@ -740,7 +740,11 @@ get_exif_default_category (const Exiv2::Exifdatum &md) + + + static void ++#if EXIV2_TEST_VERSION(0,28,0) ++exiv2_read_metadata (Exiv2::Image::UniquePtr image, ++#else + exiv2_read_metadata (Exiv2::Image::AutoPtr image, ++#endif + GFileInfo *info, + gboolean update_general_attributes) + { +@@ -875,7 +879,11 @@ exiv2_read_metadata_from_file (GFile *file, + return FALSE; + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(path); ++#else + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path); ++#endif + g_free (path); + + if (image.get() == 0) { +@@ -885,9 +893,17 @@ exiv2_read_metadata_from_file (GFile *file, + } + // Set the log level to only show errors (and suppress warnings, informational and debug messages) + Exiv2::LogMsg::setLevel(Exiv2::LogMsg::error); ++#if EXIV2_TEST_VERSION(0,28,0) ++ exiv2_read_metadata (std::move(image), info, update_general_attributes); ++#else + exiv2_read_metadata (image, info, update_general_attributes); ++#endif + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + if (error != NULL) + *error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, e.what()); + return FALSE; +@@ -906,7 +922,11 @@ exiv2_read_metadata_from_buffer (void *buffer, + GError **error) + { + try { ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) buffer, buffer_size); ++#else + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) buffer, buffer_size); ++#endif + + if (image.get() == 0) { + if (error != NULL) +@@ -914,9 +934,17 @@ exiv2_read_metadata_from_buffer (void *buffer, + return FALSE; + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++ exiv2_read_metadata (std::move(image), info, update_general_attributes); ++#else + exiv2_read_metadata (image, info, update_general_attributes); ++#endif + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + if (error != NULL) + *error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, e.what()); + return FALSE; +@@ -965,7 +993,11 @@ exiv2_read_sidecar (GFile *file, + g_free (path); + + std::string xmpPacket; ++#if EXIV2_TEST_VERSION(0,28,0) ++ xmpPacket.assign(reinterpret_cast(buf.data()), buf.size()); ++#else + xmpPacket.assign(reinterpret_cast(buf.pData_), buf.size_); ++#endif + Exiv2::XmpData xmpData; + + if (0 != Exiv2::XmpParser::decode(xmpData, xmpPacket)) +@@ -1011,7 +1043,11 @@ exiv2_read_sidecar (GFile *file, + + set_attributes_from_tagsets (info, update_general_attributes); + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + std::cerr << "Caught Exiv2 exception '" << e << "'\n"; + return FALSE; + } +@@ -1111,7 +1147,11 @@ dump_exif_data (Exiv2::ExifData &exifData, + + + static Exiv2::DataBuf ++#if EXIV2_TEST_VERSION(0,28,0) ++exiv2_write_metadata_private (Exiv2::Image::UniquePtr image, ++#else + exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, ++#endif + GFileInfo *info, + GthImage *image_data) + { +@@ -1148,13 +1188,21 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, + const char *value_type = gth_main_get_metadata_type (metadatum, attributes[i]); + + if ((raw_value != NULL) && (strcmp (raw_value, "") != 0) && (value_type != NULL)) { ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Value::UniquePtr value = Exiv2::Value::create (Exiv2::TypeInfo::typeId (value_type)); ++#else + Exiv2::Value::AutoPtr value = Exiv2::Value::create (Exiv2::TypeInfo::typeId (value_type)); ++#endif + value->read (raw_value); + Exiv2::ExifKey exif_key(key); + ed.add (exif_key, value.get()); + } + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + /* we don't care about invalid key errors */ + g_warning ("%s", e.what()); + } +@@ -1270,7 +1318,11 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, + value_type = gth_main_get_metadata_type (metadatum, attributes[i]); + if (value_type != NULL) { + /* See the exif data code above for an explanation. */ ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Value::UniquePtr value = Exiv2::Value::create (Exiv2::TypeInfo::typeId (value_type)); ++#else + Exiv2::Value::AutoPtr value = Exiv2::Value::create (Exiv2::TypeInfo::typeId (value_type)); ++#endif + Exiv2::IptcKey iptc_key(key); + + const char *raw_value; +@@ -1296,7 +1348,11 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, + } + } + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + /* we don't care about invalid key errors */ + g_warning ("%s", e.what()); + } +@@ -1320,7 +1376,11 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, + value_type = gth_main_get_metadata_type (metadatum, attributes[i]); + if (value_type != NULL) { + /* See the exif data code above for an explanation. */ ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Value::UniquePtr value = Exiv2::Value::create (Exiv2::TypeInfo::typeId (value_type)); ++#else + Exiv2::Value::AutoPtr value = Exiv2::Value::create (Exiv2::TypeInfo::typeId (value_type)); ++#endif + Exiv2::XmpKey xmp_key(key); + + const char *raw_value; +@@ -1346,7 +1406,11 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, + } + } + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + /* we don't care about invalid key errors */ + g_warning ("%s", e.what()); + } +@@ -1362,7 +1426,11 @@ exiv2_write_metadata_private (Exiv2::Image::AutoPtr image, + image->setXmpData(xd); + image->writeMetadata(); + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + g_warning ("%s", e.what()); + } + +@@ -1389,16 +1457,33 @@ exiv2_write_metadata (GthImageSaveData *data) + { + if (exiv2_supports_writes (data->mime_type) && (data->file_data != NULL)) { + try { ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) data->buffer, data->buffer_size); ++#else + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) data->buffer, data->buffer_size); ++#endif + g_assert (image.get() != 0); + ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::DataBuf buf = exiv2_write_metadata_private (std::move(image), data->file_data->info, data->image); ++#else + Exiv2::DataBuf buf = exiv2_write_metadata_private (image, data->file_data->info, data->image); ++#endif + + g_free (data->buffer); ++#if EXIV2_TEST_VERSION(0,28,0) ++ data->buffer = g_memdup (buf.data(), buf.size()); ++ data->buffer_size = buf.size(); ++#else + data->buffer = g_memdup (buf.pData_, buf.size_); + data->buffer_size = buf.size_; ++#endif + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + if (data->error != NULL) + *data->error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, e.what()); + g_warning ("%s\n", e.what()); +@@ -1419,16 +1504,33 @@ exiv2_write_metadata_to_buffer (void **buffer, + GError **error) + { + try { ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) *buffer, *buffer_size); ++#else + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) *buffer, *buffer_size); ++#endif + g_assert (image.get() != 0); + ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::DataBuf buf = exiv2_write_metadata_private (std::move(image), info, image_data); ++#else + Exiv2::DataBuf buf = exiv2_write_metadata_private (image, info, image_data); ++#endif + + g_free (*buffer); ++#if EXIV2_TEST_VERSION(0,28,0) ++ *buffer = g_memdup (buf.data(), buf.size()); ++ *buffer_size = buf.size(); ++#else + *buffer = g_memdup (buf.pData_, buf.size_); + *buffer_size = buf.size_; ++#endif + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + if (error != NULL) + *error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, e.what()); + return FALSE; +@@ -1445,7 +1547,11 @@ exiv2_clear_metadata (void **buffer, + GError **error) + { + try { ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) *buffer, *buffer_size); ++#else + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open ((Exiv2::byte*) *buffer, *buffer_size); ++#endif + + if (image.get() == 0) { + if (error != NULL) +@@ -1457,7 +1563,11 @@ exiv2_clear_metadata (void **buffer, + image->clearMetadata(); + image->writeMetadata(); + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + g_warning ("%s", e.what()); + } + +@@ -1466,10 +1576,19 @@ exiv2_clear_metadata (void **buffer, + Exiv2::DataBuf buf = io.read(io.size()); + + g_free (*buffer); ++#if EXIV2_TEST_VERSION(0,28,0) ++ *buffer = g_memdup (buf.data(), buf.size()); ++ *buffer_size = buf.size(); ++#else + *buffer = g_memdup (buf.pData_, buf.size_); + *buffer_size = buf.size_; ++#endif + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + if (error != NULL) + *error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, e.what()); + return FALSE; +@@ -1502,26 +1621,44 @@ exiv2_generate_thumbnail (const char *uri, + if (path == NULL) + return NULL; + ++#if EXIV2_TEST_VERSION(0,28,0) ++ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open (path); ++#else + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open (path); ++#endif + image->readMetadata (); + Exiv2::ExifThumbC exifThumb (image->exifData ()); + Exiv2::DataBuf thumb = exifThumb.copy (); + + g_free (path); + ++#if EXIV2_TEST_VERSION(0,28,0) ++ if (thumb.data() == NULL) ++#else + if (thumb.pData_ == NULL) ++#endif + return NULL; + + Exiv2::ExifData &ed = image->exifData(); + ++#if EXIV2_TEST_VERSION(0,28,0) ++ long orientation = (ed["Exif.Image.Orientation"].count() > 0) ? ed["Exif.Image.Orientation"].toUint32() : 1; ++ long image_width = (ed["Exif.Photo.PixelXDimension"].count() > 0) ? ed["Exif.Photo.PixelXDimension"].toUint32() : -1; ++ long image_height = (ed["Exif.Photo.PixelYDimension"].count() > 0) ? ed["Exif.Photo.PixelYDimension"].toUint32() : -1; ++#else + long orientation = (ed["Exif.Image.Orientation"].count() > 0) ? ed["Exif.Image.Orientation"].toLong() : 1; + long image_width = (ed["Exif.Photo.PixelXDimension"].count() > 0) ? ed["Exif.Photo.PixelXDimension"].toLong() : -1; + long image_height = (ed["Exif.Photo.PixelYDimension"].count() > 0) ? ed["Exif.Photo.PixelYDimension"].toLong() : -1; ++#endif + + if ((orientation != 1) || (image_width <= 0) || (image_height <= 0)) + return NULL; + ++#if EXIV2_TEST_VERSION(0,28,0) ++ GInputStream *stream = g_memory_input_stream_new_from_data (thumb.data(), thumb.size(), NULL); ++#else + GInputStream *stream = g_memory_input_stream_new_from_data (thumb.pData_, thumb.size_, NULL); ++#endif + pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, NULL); + g_object_unref (stream); + +@@ -1575,7 +1712,11 @@ exiv2_generate_thumbnail (const char *uri, + gdk_pixbuf_set_option (pixbuf, "orientation", orientation_s); + g_free (orientation_s); + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ catch (Exiv2::Error& e) { ++#else + catch (Exiv2::AnyError& e) { ++#endif + } + + return pixbuf;