FreeBSD Bugzilla – Attachment 243143 Details for
Bug 272311
graphics/exiv2: upgrade to v0.28
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
graphics/nomacs: make compatible with exiv2 0.28
0014-graphics-nomacs-make-compatible-with-exiv2-0.28.patch (text/plain), 9.26 KB, created by
Matthias Andree
on 2023-07-02 14:56:49 UTC
(
hide
)
Description:
graphics/nomacs: make compatible with exiv2 0.28
Filename:
MIME Type:
Creator:
Matthias Andree
Created:
2023-07-02 14:56:49 UTC
Size:
9.26 KB
patch
obsolete
>From 4b4ae4d9ff15ecf32030a4b08a84834f403c3a2b Mon Sep 17 00:00:00 2001 >From: Matthias Andree <mandree@FreeBSD.org> >Date: Sun, 2 Jul 2023 16:19:04 +0200 >Subject: [PATCH 14/20] graphics/nomacs: make compatible with exiv2 0.28 > >PR: 272311 >--- > graphics/nomacs/Makefile | 2 +- > ...atch-ImageLounge_src_DkCore_DkMetaData.cpp | 187 ++++++++++++++++++ > .../patch-ImageLounge_src_DkCore_DkMetaData.h | 20 ++ > 3 files changed, 208 insertions(+), 1 deletion(-) > create mode 100644 graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.cpp > create mode 100644 graphics/nomacs/files/patch-ImageLounge_src_DkCore_DkMetaData.h > >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; >-- >2.41.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
vidar
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 272311
:
243098
|
243100
|
243103
|
243104
|
243106
|
243111
|
243124
|
243125
|
243135
|
243136
|
243137
|
243138
|
243139
|
243140
|
243141
|
243142
| 243143 |
243144
|
243145
|
243146
|
243147
|
243148
|
243154
|
243155
|
243156
|
243157
|
243158
|
243159
|
243160
|
243166
|
243167
|
243168
|
243169
|
243170
|
243171
|
243172
|
243175
|
243176