Date: Sun, 9 Jul 2023 22:09:37 GMT From: Matthias Andree <mandree@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: c18dfc530ea2 - main - graphics/nomacs: make compatible with exiv2 0.28 Message-ID: <202307092209.369M9bRv034243@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=c18dfc530ea227bb514506dfc7295b91e0b4adcf commit c18dfc530ea227bb514506dfc7295b91e0b4adcf Author: Matthias Andree <mandree@FreeBSD.org> AuthorDate: 2023-07-02 14:19:04 +0000 Commit: Matthias Andree <mandree@FreeBSD.org> CommitDate: 2023-07-09 22:08:09 +0000 graphics/nomacs: make compatible with exiv2 0.28 PR: 272311 --- graphics/nomacs/Makefile | 2 +- .../patch-ImageLounge_src_DkCore_DkMetaData.cpp | 187 +++++++++++++++++++++ .../patch-ImageLounge_src_DkCore_DkMetaData.h | 20 +++ 3 files changed, 208 insertions(+), 1 deletion(-) diff --git a/graphics/nomacs/Makefile b/graphics/nomacs/Makefile index 89371488a3f2..3fc5349a98bf 100644 --- a/graphics/nomacs/Makefile +++ b/graphics/nomacs/Makefile @@ -1,7 +1,7 @@ PORTNAME= nomacs PORTVERSION= 3.16 DISTVERSIONSUFFIX= .224 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= graphics PATCH_SITES= https://github.com/nomacs/nomacs/commit/ diff --git a/graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.cpp b/graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.cpp new file mode 100644 index 000000000000..88134b70400f --- /dev/null +++ b/graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.cpp @@ -0,0 +1,187 @@ +--- ImageLounge/src/DkCore/DkMetaData.cpp.orig 2020-07-17 07:05:29 UTC ++++ ImageLounge/src/DkCore/DkMetaData.cpp +@@ -73,8 +73,8 @@ void DkMetaDataT::readMetaData(const QString& filePath + mExifImg = Exiv2::ImageFactory::open(strFilePath); + } + else { +- Exiv2::BasicIo::AutoPtr exifBuffer(new Exiv2::MemIo((const byte*)ba->constData(), ba->size())); +- mExifImg = Exiv2::ImageFactory::open(exifBuffer); ++ Exiv2::BasicIo::UniquePtr exifBuffer(new Exiv2::MemIo((const byte*)ba->constData(), ba->size())); ++ mExifImg = Exiv2::ImageFactory::open(std::move(exifBuffer)); + } + } + catch (...) { +@@ -156,13 +156,13 @@ bool DkMetaDataT::saveMetaData(QSharedPointer<QByteArr + Exiv2::XmpData &xmpData = mExifImg->xmpData(); + Exiv2::IptcData &iptcData = mExifImg->iptcData(); + +- Exiv2::Image::AutoPtr exifImgN; +- Exiv2::MemIo::AutoPtr exifMem; ++ Exiv2::Image::UniquePtr exifImgN; ++ Exiv2::MemIo::UniquePtr exifMem; + + try { + +- exifMem = Exiv2::MemIo::AutoPtr(new Exiv2::MemIo((byte*)ba->data(), ba->size())); +- exifImgN = Exiv2::ImageFactory::open(exifMem); ++ exifMem = Exiv2::MemIo::UniquePtr(new Exiv2::MemIo((byte*)ba->data(), ba->size())); ++ exifImgN = Exiv2::ImageFactory::open(std::move(exifMem)); + } + catch (...) { + +@@ -186,8 +186,8 @@ bool DkMetaDataT::saveMetaData(QSharedPointer<QByteArr + + // now get the data again + Exiv2::DataBuf exifBuf = exifImgN->io().read((long)exifImgN->io().size()); +- if (exifBuf.pData_) { +- QSharedPointer<QByteArray> tmp = QSharedPointer<QByteArray>(new QByteArray((const char*)exifBuf.pData_, exifBuf.size_)); ++ if (exifBuf.c_data()) { ++ QSharedPointer<QByteArray> tmp = QSharedPointer<QByteArray>(new QByteArray((const char*)exifBuf.c_data(), exifBuf.size())); + + if (tmp->size() > qRound(ba->size()*0.5f)) + ba = tmp; +@@ -197,7 +197,7 @@ bool DkMetaDataT::saveMetaData(QSharedPointer<QByteArr + else + return false; + +- mExifImg = exifImgN; ++ mExifImg = std::move(exifImgN); + mExifState = loaded; + + return true; +@@ -250,7 +250,7 @@ int DkMetaDataT::getOrientationDegree() const { + + if (pos != exifData.end() && pos->count() != 0) { + +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ Exiv2::Value::UniquePtr v = pos->getValue(); + orientation = (int)pos->toFloat(); + + switch (orientation) { +@@ -315,7 +315,7 @@ int DkMetaDataT::getRating() const { + Exiv2::ExifData::iterator pos = exifData.findKey(key); + + if (pos != exifData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ Exiv2::Value::UniquePtr v = pos->getValue(); + exifRating = v->toFloat(); + } + } +@@ -327,7 +327,7 @@ int DkMetaDataT::getRating() const { + + //xmp Rating tag + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ Exiv2::Value::UniquePtr v = pos->getValue(); + xmpRating = v->toFloat(); + } + +@@ -336,7 +336,7 @@ int DkMetaDataT::getRating() const { + key = Exiv2::XmpKey("Xmp.MicrosoftPhoto.Rating"); + pos = xmpData.findKey(key); + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ Exiv2::Value::UniquePtr v = pos->getValue(); + xmpRating = v->toFloat(); + } + } +@@ -399,7 +399,7 @@ QString DkMetaDataT::getNativeExifValue(const QString& + if (pos->count () < 2000) { // diem: this is about performance - adobe obviously embeds whole images into tiff exiv data + + //qDebug() << "pos count: " << pos->count(); +- //Exiv2::Value::AutoPtr v = pos->getValue(); ++ //Exiv2::Value::UniquePtr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + + } +@@ -436,7 +436,7 @@ QString DkMetaDataT::getXmpValue(const QString& key) c + } + + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ Exiv2::Value::UniquePtr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -478,7 +478,7 @@ QString DkMetaDataT::getExifValue(const QString& key) + } + + if (pos != exifData.end() && pos->count() != 0) { +- //Exiv2::Value::AutoPtr v = pos->getValue(); ++ //Exiv2::Value::UniquePtr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -508,7 +508,7 @@ QString DkMetaDataT::getIptcValue(const QString& key) + } + + if (pos != iptcData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ Exiv2::Value::UniquePtr v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -654,7 +654,7 @@ QImage DkMetaDataT::getThumbnail() const { + Exiv2::ExifThumb thumb(exifData); + Exiv2::DataBuf buffer = thumb.copy(); + +- QByteArray ba = QByteArray((char*)buffer.pData_, buffer.size_); ++ QByteArray ba = QByteArray((char*)buffer.c_data(), buffer.size()); + qThumb.loadFromData(ba); + } + catch (...) { +@@ -931,8 +931,8 @@ void DkMetaDataT::setThumbnail(QImage thumb) { + + try { + // whipe all exif data of the thumbnail +- Exiv2::MemIo::AutoPtr exifBufferThumb(new Exiv2::MemIo((const byte*)ba.constData(), ba.size())); +- Exiv2::Image::AutoPtr exifImgThumb = Exiv2::ImageFactory::open(exifBufferThumb); ++ Exiv2::MemIo::UniquePtr exifBufferThumb(new Exiv2::MemIo((const byte*)ba.constData(), ba.size())); ++ Exiv2::Image::UniquePtr exifImgThumb = Exiv2::ImageFactory::open(std::move(exifBufferThumb)); + + if (exifImgThumb.get() != 0 && exifImgThumb->good()) + exifImgThumb->clearExifData(); +@@ -1045,11 +1045,11 @@ void DkMetaDataT::setOrientation(int o) { + pos = exifData.findKey(key); + } + +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ Exiv2::Value::UniquePtr v = pos->getValue(); + Exiv2::UShortValue* prv = dynamic_cast<Exiv2::UShortValue*>(v.release()); + if (!prv) return; + +- Exiv2::UShortValue::AutoPtr rv = Exiv2::UShortValue::AutoPtr(prv); ++ Exiv2::UShortValue::UniquePtr rv = Exiv2::UShortValue::UniquePtr(prv); + if (rv->value_.empty()) return; + + orientation = (int) rv->value_[0]; +@@ -1110,7 +1110,7 @@ void DkMetaDataT::setRating(int r) { + exifData["Exif.Image.Rating"] = uint16_t(r); + exifData["Exif.Image.RatingPercent"] = uint16_t(r); + +- Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::xmpText); ++ Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpText); + v->read(sRating); + xmpData.add(Exiv2::XmpKey("Xmp.xmp.Rating"), v.get()); + v->read(sRatingPercent); +@@ -1354,9 +1354,9 @@ DkRotatingRect DkMetaDataT::getXMPRect(const QSize& si + return DkRotatingRect(rr); + } + +-Exiv2::Image::AutoPtr DkMetaDataT::loadSidecar(const QString& filePath) const { ++Exiv2::Image::UniquePtr DkMetaDataT::loadSidecar(const QString& filePath) const { + +- Exiv2::Image::AutoPtr xmpImg; ++ Exiv2::Image::UniquePtr xmpImg; + + //TODO: check if the file type supports xmp + +@@ -1409,7 +1409,7 @@ bool DkMetaDataT::setXMPValue(Exiv2::XmpData& xmpData, + setXMPValueSuccessful = true; + } + else { +- Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::xmpText); ++ Exiv2::Value::UniquePtr v = Exiv2::Value::create(Exiv2::xmpText); + if (!v->read(xmpValue.toStdString())) { + if (!xmpData.add(Exiv2::XmpKey(key), v.get())) + setXMPValueSuccessful = true; diff --git a/graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.h b/graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.h new file mode 100644 index 000000000000..ef9042eeaff1 --- /dev/null +++ b/graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.h @@ -0,0 +1,20 @@ +--- ImageLounge/src/DkCore/DkMetaData.h.orig 2020-07-17 07:05:29 UTC ++++ ImageLounge/src/DkCore/DkMetaData.h +@@ -148,7 +148,7 @@ class DllCoreExport DkMetaDataT { (public) + + protected: + +- Exiv2::Image::AutoPtr loadSidecar(const QString& filePath) const; ++ Exiv2::Image::UniquePtr loadSidecar(const QString& filePath) const; + + enum { + not_loaded, +@@ -157,7 +157,7 @@ class DllCoreExport DkMetaDataT { (public) + dirty, + }; + +- Exiv2::Image::AutoPtr mExifImg; ++ Exiv2::Image::UniquePtr mExifImg; + QString mFilePath; + QStringList mQtKeys; + QStringList mQtValues;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307092209.369M9bRv034243>