From nobody Sun Jul 09 22:09:44 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 4QzhBf0477z4mqpr; Sun, 9 Jul 2023 22:09:46 +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 4QzhBc4rSkz3CfB; Sun, 9 Jul 2023 22:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688940584; 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=LpjR8VW/Y8sAXbtRXvOz6w/IUNesZK4gh8EVP+zYkwg=; b=j2RinqQSZ0X6GoXs3tp8j/htTNHgu0TrCONABjCHKmlvvVJNC0bzLar/v8AFojdoxaqn2+ JJMrmAkDtxETQfGzFaBoahjmTOr+fYY2Mhc2kWZ9c6OFA5ApL6cJOFjwPhc0FGzkKAkjWk y+VNcou/N43DCKBRn3NDKZnbGPNGVTmKFmNQJnz20x4YXtqQdmOENnDWQn+xi11Cw0Z9A+ uJ15i5XWbMaDQdErtlM9pGy3KBP1Xw66CaiQr2vopY8engLjeP0LGD9yv835qycw32PufB gCbqmvRlC1+sFWAc2tLp39Ag6KxFk0IbQMykxQ+qZNKRo4TMt16sSgbe5Y/2Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688940584; 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=LpjR8VW/Y8sAXbtRXvOz6w/IUNesZK4gh8EVP+zYkwg=; b=ZTwDUz/oagTtNCc0dzMS4fg3NFhFBtIwGF4t3mB5cxV84JtQtd5asf+B2Oqw6CB6zlXGJD /Bi6GPIjeqGWuWVyhKYM5/7RZgXZ9wgVtpT6j6k+W+8WKbpef52l5v3g5Pw0aT1zdvXnAF X6/uWuml9ILnzuPVr6KsjXPocLOWMmpUqzbCIzxQiyoIrpvYP8fwMKek4rnj46MSKZf0Vo qlQbDWN4wDVKqveXlMauwx7ZXwONs9aM6afe2lu+lO8s94ySR6+39DOUtvVGp2T0LLRdIi mKYkgQSODupgvDNVzZmBrC7T93rc9ClUd1dzvLq0vDVWsUY8YU8WT2OoeiSfzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688940584; a=rsa-sha256; cv=none; b=robvcwu7JtKrkiJlX1+5VYoJBpvTenwJCqcsUpmA0hPiQpIOWzcQEkMTyUE6vYzaq26gnW gi1lzHW8Tx5muQfIerCTUo0ZlV3oZ5Ps2xVkTMwSVboOyRGhwBCcT/ikqEJDmSv5Y05yzO 9LbRqUMa5zJz4IjWQDjMuFd7yyxnCgvN24UKsV6tbHMbqgfwc5JC+DUa92MDhNsjRyNiFQ Rs5xf9UPjT/ZKayKSXC7uuTBV5Dtc/STz3eEKYffgv53wSo8KFT+1HFXF5ka/pHUQW+8fY gbgs42kFRJsSLAD2IeasiliwnfWpdw79nSfZHxxV8cxPCI+EKGAPbpFLtdm3nA== 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 4QzhBc3x3SzKhq; Sun, 9 Jul 2023 22:09:44 +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 369M9iV0034364; Sun, 9 Jul 2023 22:09:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 369M9iPu034363; Sun, 9 Jul 2023 22:09:44 GMT (envelope-from git) Date: Sun, 9 Jul 2023 22:09:44 GMT Message-Id: <202307092209.369M9iPu034363@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: 164a774986db - main - graphics/rawstudio: 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: 164a774986db9c3161e903ddd059f6e54c7b5981 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=164a774986db9c3161e903ddd059f6e54c7b5981 commit 164a774986db9c3161e903ddd059f6e54c7b5981 Author: Matthias Andree AuthorDate: 2023-07-02 21:45:05 +0000 Commit: Matthias Andree CommitDate: 2023-07-09 22:08:11 +0000 graphics/rawstudio: make compatible with exiv2 0.28 PR: 272311 --- graphics/rawstudio/Makefile | 2 +- .../rawstudio/files/patch-librawstudio_rs-exif.cc | 65 +++++++++++++++++++ .../patch-plugins_load-gdk_exiv2-colorspace.cpp | 39 ++++++++++++ .../patch-plugins_meta-exiv2_exiv2-metadata.cpp | 72 ++++++++++++++++++++++ 4 files changed, 177 insertions(+), 1 deletion(-) diff --git a/graphics/rawstudio/Makefile b/graphics/rawstudio/Makefile index 012718ecd940..be8cc343842e 100644 --- a/graphics/rawstudio/Makefile +++ b/graphics/rawstudio/Makefile @@ -1,6 +1,6 @@ PORTNAME= rawstudio PORTVERSION= 2.0 -PORTREVISION= 23 +PORTREVISION= 24 CATEGORIES= graphics MASTER_SITES= http://rawstudio.org/files/release/ diff --git a/graphics/rawstudio/files/patch-librawstudio_rs-exif.cc b/graphics/rawstudio/files/patch-librawstudio_rs-exif.cc index b6ba4a48bf13..2431223e2666 100644 --- a/graphics/rawstudio/files/patch-librawstudio_rs-exif.cc +++ b/graphics/rawstudio/files/patch-librawstudio_rs-exif.cc @@ -9,3 +9,68 @@ #include "rs-exif.h" #include #include "rs-library.h" +@@ -128,7 +130,7 @@ rs_exif_load_from_file(const gchar *filename) + RS_EXIF_DATA *exif_data; + try + { +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename); ++ Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(filename) }; + assert(image.get() != 0); + image->readMetadata(); + +@@ -136,7 +138,7 @@ rs_exif_load_from_file(const gchar *filename) + + exif_data_init(exif_data); + } +- catch (Exiv2::AnyError& e) ++ catch (Exiv2::Error& e) + { + g_warning("Could not load EXIF data from file %s", filename); + return NULL; +@@ -151,8 +153,8 @@ rs_exif_load_from_rawfile(RAWFILE *rawfile) + RS_EXIF_DATA *rs_exif_data; + try + { +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open( +- (const Exiv2::byte*) raw_get_map(rawfile), raw_get_filesize(rawfile)); ++ Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open( ++ (const Exiv2::byte*) raw_get_map(rawfile), raw_get_filesize(rawfile)) }; + + assert(image.get() != 0); + image->readMetadata(); +@@ -161,7 +163,7 @@ rs_exif_load_from_rawfile(RAWFILE *rawfile) + + exif_data_init(rs_exif_data); + } +- catch (Exiv2::AnyError& e) ++ catch (Exiv2::Error& e) + { + g_warning("Could not load EXIF data"); + return NULL; +@@ -179,7 +181,7 @@ rs_exif_add_to_file(RS_EXIF_DATA *d, Exiv2::IptcData & + try + { + Exiv2::ExifData *data = (Exiv2::ExifData *) d; +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename); ++ Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(filename) }; + + /* Copy EXIF to XMP */ + #if EXIV2_TEST_VERSION(0,17,0) +@@ -194,7 +196,7 @@ rs_exif_add_to_file(RS_EXIF_DATA *d, Exiv2::IptcData & + image->setIptcData(iptc_data); + image->writeMetadata(); + } +- catch (Exiv2::AnyError& e) ++ catch (Exiv2::Error& e) + { + g_warning("Couldn't add EXIF data to %s", filename); + } +@@ -263,7 +265,7 @@ rs_add_tags_exif(RS_EXIF_DATA *d, const gchar *input_f + + glong items_written; + gunichar2 *w = g_utf8_to_utf16(xpkeyw->str, -1, NULL, &items_written, NULL); +- Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::unsignedByte); ++ Exiv2::Value::UniquePtr v { Exiv2::Value::create(Exiv2::unsignedByte) }; + v->read((const Exiv2::byte*)w, items_written * sizeof(gunichar2), Exiv2::invalidByteOrder); + Exiv2::ExifKey key = Exiv2::ExifKey("Exif.Image.XPKeywords"); + data->add(key, v.get()); diff --git a/graphics/rawstudio/files/patch-plugins_load-gdk_exiv2-colorspace.cpp b/graphics/rawstudio/files/patch-plugins_load-gdk_exiv2-colorspace.cpp index 66b5ee793016..bbb02c33175e 100644 --- a/graphics/rawstudio/files/patch-plugins_load-gdk_exiv2-colorspace.cpp +++ b/graphics/rawstudio/files/patch-plugins_load-gdk_exiv2-colorspace.cpp @@ -23,3 +23,42 @@ if (retval != 0) { RSIccProfile *icc = rs_icc_profile_new_from_memory((gchar*)icc_profile, icc_profile_size, TRUE); +@@ -151,7 +153,7 @@ jpeg_fail: + #endif + + try { +- Image::AutoPtr img = ImageFactory::open(filename); ++ Image::UniquePtr img { ImageFactory::open(filename) }; + img->readMetadata(); + ExifData &exifData = img->exifData(); + *linear_guess = FALSE; +@@ -169,13 +171,13 @@ jpeg_fail: + ExifData::const_iterator i; + i = exifData.findKey(ExifKey("Exif.Image.BitsPerSample")); + if (i != exifData.end()) +- if (i->toLong() == 16) ++ if (i->toInt64() == 16) + *linear_guess = TRUE; + + i = exifData.findKey(ExifKey("Exif.Photo.ColorSpace")); + if (i != exifData.end()) + { +- if (i->toLong() == 1) ++ if (i->toInt64() == 1) + return rs_color_space_new_singleton("RSSrgb"); + } + +@@ -184,10 +186,10 @@ jpeg_fail: + if (i != exifData.end()) + { + DataBuf buf(i->size()); +- i->copy(buf.pData_, Exiv2::invalidByteOrder); +- if (buf.pData_ && buf.size_) ++ i->copy(buf.data(), Exiv2::invalidByteOrder); ++ if (buf.c_data() && buf.size()) + { +- RSIccProfile *icc = rs_icc_profile_new_from_memory((gchar*)buf.pData_, buf.size_, TRUE); ++ RSIccProfile *icc = rs_icc_profile_new_from_memory((gchar*)buf.c_data(), buf.size(), TRUE); + return rs_color_space_icc_new_from_icc(icc); + } + } diff --git a/graphics/rawstudio/files/patch-plugins_meta-exiv2_exiv2-metadata.cpp b/graphics/rawstudio/files/patch-plugins_meta-exiv2_exiv2-metadata.cpp index c78ebecd9bf2..fb735ba22727 100644 --- a/graphics/rawstudio/files/patch-plugins_meta-exiv2_exiv2-metadata.cpp +++ b/graphics/rawstudio/files/patch-plugins_meta-exiv2_exiv2-metadata.cpp @@ -9,3 +9,75 @@ #include #include "exiv2-metadata.h" #include +@@ -94,7 +96,7 @@ gboolean + exiv2_load_meta_interface(const gchar *service, RAWFILE *rawfile, guint offset, RSMetadata *meta) + { + try { +- Image::AutoPtr img = ImageFactory::open((byte*)raw_get_map(rawfile), raw_get_filesize(rawfile)); ++ Image::UniquePtr img { ImageFactory::open((byte*)raw_get_map(rawfile), raw_get_filesize(rawfile)) }; + img->readMetadata(); + ExifData &exifData = img->exifData(); + +@@ -121,7 +123,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL + i = orientation(exifData); + if (i != exifData.end()) + { +- switch (i->getValue()->toLong()) ++ switch (i->getValue()->toInt64()) + { + case 6: meta->orientation = 90; + break; +@@ -173,7 +175,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL + #if EXIV2_TEST_VERSION(0,19,0) + i = isoSpeed(exifData); + if (i != exifData.end()) +- meta->iso = i->toLong(); ++ meta->iso = i->toInt64(); + + /* Text based Lens Identifier */ + i = lensName(exifData); +@@ -181,7 +183,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL + { + TypeId type = i->typeId(); + if (type == unsignedShort || type == unsignedLong || type == signedShort || type == signedLong || type == unsignedByte || type == signedByte) +- meta->lens_id = i->toLong(); ++ meta->lens_id = i->toInt64(); + else if (type == asciiString || type == string) + meta->fixed_lens_identifier = g_strdup(i->toString().c_str()); + } +@@ -223,7 +225,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL + if (i == exifData.end()) + i = exifData.findKey(ExifKey("Exif.NikonLd3.MinFocalLength")); + if (i != exifData.end()) +- meta->lens_min_focal = 5.0 * pow(2.0, i->toLong()/24.0); ++ meta->lens_min_focal = 5.0 * pow(2.0, i->toInt64()/24.0); + + i = exifData.findKey(ExifKey("Exif.NikonLd1.MaxFocalLength")); + if (i == exifData.end()) +@@ -231,7 +233,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL + if (i == exifData.end()) + i = exifData.findKey(ExifKey("Exif.NikonLd3.MaxFocalLength")); + if (i != exifData.end()) +- meta->lens_max_focal = 5.0 * pow(2.0, i->toLong()/24.0); ++ meta->lens_max_focal = 5.0 * pow(2.0, i->toInt64()/24.0); + + i = exifData.findKey(ExifKey("Exif.NikonLd1.MaxApertureAtMinFocal")); + if (i == exifData.end()) +@@ -239,7 +241,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL + if (i == exifData.end()) + i = exifData.findKey(ExifKey("Exif.NikonLd3.MaxApertureAtMinFocal")); + if (i != exifData.end()) +- meta->lens_min_aperture = i->toLong()/12.0; ++ meta->lens_min_aperture = i->toInt64()/12.0; + + i = exifData.findKey(ExifKey("Exif.NikonLd1.MaxApertureAtMaxFocal")); + if (i == exifData.end()) +@@ -247,7 +249,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL + if (i == exifData.end()) + i = exifData.findKey(ExifKey("Exif.NikonLd3.MaxApertureAtMaxFocal")); + if (i != exifData.end()) +- meta->lens_max_aperture = i->toLong()/12.0; ++ meta->lens_max_aperture = i->toInt64()/12.0; + + /* Fuji */ + i = exifData.findKey(ExifKey("Exif.Fujifilm.MinFocalLength"));