diff options
Diffstat (limited to 'media-gfx/nomacs/files')
3 files changed, 294 insertions, 0 deletions
diff --git a/media-gfx/nomacs/files/nomacs-3.16.224-exiv2-0.28.patch b/media-gfx/nomacs/files/nomacs-3.16.224-exiv2-0.28.patch new file mode 100644 index 000000000000..280d7ec59e8b --- /dev/null +++ b/media-gfx/nomacs/files/nomacs-3.16.224-exiv2-0.28.patch @@ -0,0 +1,241 @@ +From 6785f15d9ed05ebc66ee200b3c94451c6c633646 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Sun, 3 Sep 2023 13:30:43 +0200 +Subject: [PATCH] Fix 3.16.224 build with exiv2-0.28 + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + ImageLounge/src/DkCore/DkMetaData.cpp | 59 ++++++++++++++++++--------- + ImageLounge/src/DkCore/DkMetaData.h | 4 +- + 2 files changed, 41 insertions(+), 22 deletions(-) + +diff --git a/ImageLounge/src/DkCore/DkMetaData.cpp b/ImageLounge/src/DkCore/DkMetaData.cpp +index bf1d111e..5eaeebf4 100644 +--- a/ImageLounge/src/DkCore/DkMetaData.cpp ++++ b/ImageLounge/src/DkCore/DkMetaData.cpp +@@ -73,8 +73,12 @@ void DkMetaDataT::readMetaData(const QString& filePath, QSharedPointer<QByteArra + mExifImg = Exiv2::ImageFactory::open(strFilePath); + } + else { ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ mExifImg = Exiv2::ImageFactory::open((const byte *)ba->constData(), ba->size()); ++#else + Exiv2::BasicIo::AutoPtr exifBuffer(new Exiv2::MemIo((const byte*)ba->constData(), ba->size())); + mExifImg = Exiv2::ImageFactory::open(exifBuffer); ++#endif + } + } + catch (...) { +@@ -155,14 +159,18 @@ bool DkMetaDataT::saveMetaData(QSharedPointer<QByteArray>& ba, bool force) { + Exiv2::ExifData &exifData = mExifImg->exifData(); + Exiv2::XmpData &xmpData = mExifImg->xmpData(); + Exiv2::IptcData &iptcData = mExifImg->iptcData(); +- +- Exiv2::Image::AutoPtr exifImgN; ++ std::unique_ptr<Exiv2::Image> exifImgN; ++#if !EXIV2_TEST_VERSION(0, 28, 0) + Exiv2::MemIo::AutoPtr exifMem; ++#endif + + try { +- ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ exifImgN = Exiv2::ImageFactory::open((byte *)ba->data(), ba->size()); ++#else + exifMem = Exiv2::MemIo::AutoPtr(new Exiv2::MemIo((byte*)ba->data(), ba->size())); + exifImgN = Exiv2::ImageFactory::open(exifMem); ++#endif + } + catch (...) { + +@@ -186,8 +194,13 @@ bool DkMetaDataT::saveMetaData(QSharedPointer<QByteArray>& ba, bool force) { + + // now get the data again + Exiv2::DataBuf exifBuf = exifImgN->io().read((long)exifImgN->io().size()); ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ if (!exifBuf.empty()) { ++ QSharedPointer<QByteArray> tmp = QSharedPointer<QByteArray>(new QByteArray((const char *)exifBuf.c_data(), exifBuf.size())); ++#else + if (exifBuf.pData_) { + QSharedPointer<QByteArray> tmp = QSharedPointer<QByteArray>(new QByteArray((const char*)exifBuf.pData_, exifBuf.size_)); ++#endif + + if (tmp->size() > qRound(ba->size()*0.5f)) + ba = tmp; +@@ -197,7 +210,7 @@ bool DkMetaDataT::saveMetaData(QSharedPointer<QByteArray>& ba, bool force) { + else + return false; + +- mExifImg = exifImgN; ++ mExifImg.swap(exifImgN); + mExifState = loaded; + + return true; +@@ -250,7 +263,7 @@ int DkMetaDataT::getOrientationDegree() const { + + if (pos != exifData.end() && pos->count() != 0) { + +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr<Exiv2::Value> v = pos->getValue(); + orientation = (int)pos->toFloat(); + + switch (orientation) { +@@ -315,7 +328,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(); ++ std::unique_ptr<Exiv2::Value> v = pos->getValue(); + exifRating = v->toFloat(); + } + } +@@ -327,7 +340,7 @@ int DkMetaDataT::getRating() const { + + //xmp Rating tag + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr<Exiv2::Value> v = pos->getValue(); + xmpRating = v->toFloat(); + } + +@@ -336,7 +349,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(); ++ std::unique_ptr<Exiv2::Value> v = pos->getValue(); + xmpRating = v->toFloat(); + } + } +@@ -399,7 +412,7 @@ QString DkMetaDataT::getNativeExifValue(const QString& key) const { + 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(); ++ //std::unique_ptr<Exiv2::Value> v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + + } +@@ -436,7 +449,7 @@ QString DkMetaDataT::getXmpValue(const QString& key) const { + } + + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr<Exiv2::Value> v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -478,7 +491,7 @@ QString DkMetaDataT::getExifValue(const QString& key) const { + } + + if (pos != exifData.end() && pos->count() != 0) { +- //Exiv2::Value::AutoPtr v = pos->getValue(); ++ //std::unique_ptr<Exiv2::Value> v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -508,7 +521,7 @@ QString DkMetaDataT::getIptcValue(const QString& key) const { + } + + if (pos != iptcData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr<Exiv2::Value> v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -653,8 +666,11 @@ QImage DkMetaDataT::getThumbnail() const { + try { + Exiv2::ExifThumb thumb(exifData); + Exiv2::DataBuf buffer = thumb.copy(); +- ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ QByteArray ba = QByteArray((char *)buffer.c_data(), buffer.size()); ++#else + QByteArray ba = QByteArray((char*)buffer.pData_, buffer.size_); ++#endif + qThumb.loadFromData(ba); + } + catch (...) { +@@ -931,9 +947,12 @@ void DkMetaDataT::setThumbnail(QImage thumb) { + + try { + // whipe all exif data of the thumbnail ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ Exiv2::Image::UniquePtr exifImgThumb = Exiv2::ImageFactory::open((const byte *)ba.constData(), ba.size()); ++#else + Exiv2::MemIo::AutoPtr exifBufferThumb(new Exiv2::MemIo((const byte*)ba.constData(), ba.size())); + Exiv2::Image::AutoPtr exifImgThumb = Exiv2::ImageFactory::open(exifBufferThumb); +- ++#endif + if (exifImgThumb.get() != 0 && exifImgThumb->good()) + exifImgThumb->clearExifData(); + } +@@ -1045,11 +1064,11 @@ void DkMetaDataT::setOrientation(int o) { + pos = exifData.findKey(key); + } + +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ std::unique_ptr<Exiv2::Value> v = pos->getValue(); + Exiv2::UShortValue* prv = dynamic_cast<Exiv2::UShortValue*>(v.release()); + if (!prv) return; + +- Exiv2::UShortValue::AutoPtr rv = Exiv2::UShortValue::AutoPtr(prv); ++ std::unique_ptr<Exiv2::UShortValue> rv = std::unique_ptr<Exiv2::UShortValue>(prv); + if (rv->value_.empty()) return; + + orientation = (int) rv->value_[0]; +@@ -1110,7 +1129,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); ++ std::unique_ptr<Exiv2::Value> v = Exiv2::Value::create(Exiv2::xmpText); + v->read(sRating); + xmpData.add(Exiv2::XmpKey("Xmp.xmp.Rating"), v.get()); + v->read(sRatingPercent); +@@ -1354,9 +1373,9 @@ DkRotatingRect DkMetaDataT::getXMPRect(const QSize& size) const { + return DkRotatingRect(rr); + } + +-Exiv2::Image::AutoPtr DkMetaDataT::loadSidecar(const QString& filePath) const { ++std::unique_ptr<Exiv2::Image> DkMetaDataT::loadSidecar(const QString& filePath) const { + +- Exiv2::Image::AutoPtr xmpImg; ++ std::unique_ptr<Exiv2::Image> xmpImg; + + //TODO: check if the file type supports xmp + +@@ -1409,7 +1428,7 @@ bool DkMetaDataT::setXMPValue(Exiv2::XmpData& xmpData, QString xmpKey, QString x + setXMPValueSuccessful = true; + } + else { +- Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::xmpText); ++ std::unique_ptr<Exiv2::Value> v = Exiv2::Value::create(Exiv2::xmpText); + if (!v->read(xmpValue.toStdString())) { + if (!xmpData.add(Exiv2::XmpKey(key), v.get())) + setXMPValueSuccessful = true; +diff --git a/ImageLounge/src/DkCore/DkMetaData.h b/ImageLounge/src/DkCore/DkMetaData.h +index c1f73c93..183a906a 100644 +--- a/ImageLounge/src/DkCore/DkMetaData.h ++++ b/ImageLounge/src/DkCore/DkMetaData.h +@@ -148,7 +148,7 @@ public: + + protected: + +- Exiv2::Image::AutoPtr loadSidecar(const QString& filePath) const; ++ std::unique_ptr<Exiv2::Image> loadSidecar(const QString& filePath) const; + + enum { + not_loaded, +@@ -157,7 +157,7 @@ protected: + dirty, + }; + +- Exiv2::Image::AutoPtr mExifImg; ++ std::unique_ptr<Exiv2::Image> mExifImg; + QString mFilePath; + QStringList mQtKeys; + QStringList mQtValues; +-- +2.42.0 + diff --git a/media-gfx/nomacs/files/nomacs-3.16.224-libdir-plugins.patch b/media-gfx/nomacs/files/nomacs-3.16.224-libdir-plugins.patch new file mode 100644 index 000000000000..0c613929add0 --- /dev/null +++ b/media-gfx/nomacs/files/nomacs-3.16.224-libdir-plugins.patch @@ -0,0 +1,23 @@ +From e1d32cd424462b2ac414d3a4ea3e1285d5ca2aef Mon Sep 17 00:00:00 2001 +From: Markus Diem <diemmarkus@gmail.com> +Date: Mon, 27 Jul 2020 13:11:31 +0200 +Subject: [PATCH] patches wrong plugin installation path + +- thanks to @tieugene +--- + ImageLounge/plugins/cmake/Utils.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake +index f2d1b62..5578aa7 100644 +--- a/ImageLounge/plugins/cmake/Utils.cmake ++++ b/ImageLounge/plugins/cmake/Utils.cmake +@@ -139,7 +139,7 @@ macro(NMC_CREATE_TARGETS) + + elseif(UNIX) + set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${NOMACS_BUILD_DIRECTORY}/plugins) +- install(TARGETS ${PROJECT_NAME} RUNTIME LIBRARY DESTINATION lib/nomacs-plugins) ++ install(TARGETS ${PROJECT_NAME} RUNTIME LIBRARY DESTINATION lib${LIB_SUFFIX}/nomacs-plugins) + set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION ${NOMACS_VERSION_MAJOR}.${NOMACS_VERSION_MINOR}.${NOMACS_VERSION_PATCH}) + set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION ${NOMACS_VERSION_MAJOR}) + endif(MSVC) diff --git a/media-gfx/nomacs/files/nomacs-3.16.224-libdir.patch b/media-gfx/nomacs/files/nomacs-3.16.224-libdir.patch new file mode 100644 index 000000000000..50b73028f303 --- /dev/null +++ b/media-gfx/nomacs/files/nomacs-3.16.224-libdir.patch @@ -0,0 +1,30 @@ +From c8f6c325c5f5170bb473c41ee716b781d37bdd41 Mon Sep 17 00:00:00 2001 +From: Markus Diem <diemmarkus@gmail.com> +Date: Mon, 27 Jul 2020 13:19:01 +0200 +Subject: [PATCH] fixes plugin path for fedora + +- thanks @tieugene +- beta version: 3.17 +--- + ImageLounge/src/DkCore/DkPluginManager.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/ImageLounge/src/DkCore/DkPluginManager.cpp ++++ b/ImageLounge/src/DkCore/DkPluginManager.cpp +@@ -62,6 +62,7 @@ + #include <QAction> + #include <QMenu> + #include <QJsonValue> ++#include <QLibraryInfo> + #pragma warning(pop) // no warnings from includes - end + + #ifdef QT_NO_DEBUG_OUTPUT +@@ -1309,7 +1310,7 @@ void DkPluginManager::createPluginsPath() { + #ifdef Q_OS_WIN + QDir pluginsDir = QCoreApplication::applicationDirPath() + "/plugins"; + #else +- QDir pluginsDir = QCoreApplication::applicationDirPath() + "/../lib/nomacs-plugins/"; ++ QDir pluginsDir = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + "/nomacs-plugins/"; + #endif // Q_OS_WIN + + if (!pluginsDir.exists()) |