diff -Nru nomacs-3.17.2282+dfsg/debian/changelog nomacs-3.17.2282+dfsg/debian/changelog --- nomacs-3.17.2282+dfsg/debian/changelog 2023-09-06 15:10:36.000000000 +0100 +++ nomacs-3.17.2282+dfsg/debian/changelog 2024-11-03 12:51:33.000000000 +0000 @@ -1,3 +1,10 @@ +nomacs (3.17.2282+dfsg-2.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTBFS with libexiv2-28. + + -- Sudip Mukherjee Sun, 03 Nov 2024 12:51:33 +0000 + nomacs (3.17.2282+dfsg-2) unstable; urgency=medium * Change team email to diff -Nru nomacs-3.17.2282+dfsg/debian/patches/0002-avoid-autoptr.patch nomacs-3.17.2282+dfsg/debian/patches/0002-avoid-autoptr.patch --- nomacs-3.17.2282+dfsg/debian/patches/0002-avoid-autoptr.patch 1970-01-01 01:00:00.000000000 +0100 +++ nomacs-3.17.2282+dfsg/debian/patches/0002-avoid-autoptr.patch 2024-11-03 12:51:33.000000000 +0000 @@ -0,0 +1,173 @@ +Description: Avoid AutoPtr in metadata code + +Origin: upstream, https://github.com/nomacs/nomacs/commit/2faa57d6cd5f35408e5cf9579e7b1638554f0042 +Bug-Debian: https://bugs.debian.org/1081086 +Last-Update: 2024-11-03 +--- + +--- nomacs-3.17.2282+dfsg.orig/ImageLounge/src/DkCore/DkMetaData.cpp ++++ nomacs-3.17.2282+dfsg/ImageLounge/src/DkCore/DkMetaData.cpp +@@ -114,8 +114,7 @@ void DkMetaDataT::readMetaData(const QSt + std::string strFilePath = (fileInfo.isSymLink()) ? fileInfo.symLinkTarget().toStdString() : filePath.toStdString(); + mExifImg = Exiv2::ImageFactory::open(strFilePath); + } else { +- Exiv2::BasicIo::AutoPtr exifBuffer(new Exiv2::MemIo((const byte *)ba->constData(), ba->size())); +- mExifImg = Exiv2::ImageFactory::open(exifBuffer); ++ mExifImg = Exiv2::ImageFactory::open(reinterpret_cast(ba->constData()), ba->size()); + } + } catch (...) { + // TODO: check crashes here +@@ -217,13 +216,11 @@ bool DkMetaDataT::saveMetaData(QSharedPo + Exiv2::XmpData &xmpData = mExifImg->xmpData(); + Exiv2::IptcData &iptcData = mExifImg->iptcData(); + +- Exiv2::Image::AutoPtr exifImgN; +- Exiv2::MemIo::AutoPtr exifMem; ++ std::unique_ptr exifImgN; + + try { + // Load new exif object (based on byte array of raw image file, see overload) +- exifMem = Exiv2::MemIo::AutoPtr(new Exiv2::MemIo((byte *)ba->data(), ba->size())); +- exifImgN = Exiv2::ImageFactory::open(exifMem); ++ exifImgN = Exiv2::ImageFactory::open(reinterpret_cast(ba->constData()), ba->size()); + } catch (...) { + qDebug() << "could not open image for exif data"; + return false; +@@ -257,7 +254,7 @@ bool DkMetaDataT::saveMetaData(QSharedPo + return false; + + // Replace old exif object with new one and clear "dirty" flag +- mExifImg = exifImgN; ++ mExifImg.swap(exifImgN); + mExifState = loaded; + + return true; +@@ -304,7 +301,7 @@ int DkMetaDataT::getOrientationDegree() + Exiv2::ExifData::iterator pos = exifData.findKey(key); + + if (pos != exifData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ auto v = pos->getValue(); + orientation = (int)pos->toFloat(); + + switch (orientation) { +@@ -384,7 +381,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(); ++ auto v = pos->getValue(); + exifRating = v->toFloat(); + } + } +@@ -396,7 +393,7 @@ int DkMetaDataT::getRating() const + + // xmp Rating tag + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ auto v = pos->getValue(); + xmpRating = v->toFloat(); + } + +@@ -405,7 +402,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(); ++ auto v = pos->getValue(); + xmpRating = v->toFloat(); + } + } +@@ -505,7 +502,7 @@ QString DkMetaDataT::getXmpValue(const Q + } + + if (pos != xmpData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ auto v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -573,7 +570,7 @@ QString DkMetaDataT::getIptcValue(const + } + + if (pos != iptcData.end() && pos->count() != 0) { +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ auto v = pos->getValue(); + info = exiv2ToQString(pos->toString()); + } + } +@@ -994,8 +991,7 @@ void DkMetaDataT::setThumbnail(QImage th + + 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); ++ auto exifImgThumb = Exiv2::ImageFactory::open(reinterpret_cast(ba.constData()), ba.size()); + + if (exifImgThumb.get() != 0 && exifImgThumb->good()) + exifImgThumb->clearExifData(); +@@ -1106,12 +1102,12 @@ void DkMetaDataT::setOrientation(int o) + pos = exifData.findKey(key); + } + +- Exiv2::Value::AutoPtr v = pos->getValue(); ++ auto v = pos->getValue(); + Exiv2::UShortValue *prv = dynamic_cast(v.release()); + if (!prv) + return; + +- Exiv2::UShortValue::AutoPtr rv = Exiv2::UShortValue::AutoPtr(prv); ++ std::unique_ptr rv(prv); + if (rv->value_.empty()) + return; + +@@ -1202,7 +1198,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); ++ auto v = Exiv2::Value::create(Exiv2::xmpText); + v->read(sRating); + xmpData.add(Exiv2::XmpKey("Xmp.xmp.Rating"), v.get()); + v->read(sRatingPercent); +@@ -1448,9 +1444,9 @@ DkRotatingRect DkMetaDataT::getXMPRect(c + return DkRotatingRect(rr); + } + +-Exiv2::Image::AutoPtr DkMetaDataT::loadSidecar(const QString &filePath) const ++std::unique_ptr DkMetaDataT::loadSidecar(const QString &filePath) const + { +- Exiv2::Image::AutoPtr xmpImg; ++ std::unique_ptr xmpImg; + + // TODO: check if the file type supports xmp + +@@ -1500,7 +1496,7 @@ bool DkMetaDataT::setXMPValue(Exiv2::Xmp + if (!pos->setValue(xmpValue.toStdString())) + setXMPValueSuccessful = true; + } else { +- Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::xmpText); ++ auto v = Exiv2::Value::create(Exiv2::xmpText); + if (!v->read(xmpValue.toStdString())) { + if (!xmpData.add(Exiv2::XmpKey(key), v.get())) + setXMPValueSuccessful = true; +--- nomacs-3.17.2282+dfsg.orig/ImageLounge/src/DkCore/DkMetaData.h ++++ nomacs-3.17.2282+dfsg/ImageLounge/src/DkCore/DkMetaData.h +@@ -155,7 +155,7 @@ public: + bool setXMPValue(Exiv2::XmpData &xmpData, QString xmpKey, QString xmpValue); + + protected: +- Exiv2::Image::AutoPtr loadSidecar(const QString &filePath) const; ++ std::unique_ptr loadSidecar(const QString &filePath) const; + + enum { + not_loaded, +@@ -164,7 +164,7 @@ protected: + dirty, + }; + +- Exiv2::Image::AutoPtr mExifImg; // TODO std::unique_ptr (and all other *::AutoPtr) ++ std::unique_ptr mExifImg; + QString mFilePath; + QStringList mQtKeys; + QStringList mQtValues; diff -Nru nomacs-3.17.2282+dfsg/debian/patches/0003-allow-building-with-exiv2.patch nomacs-3.17.2282+dfsg/debian/patches/0003-allow-building-with-exiv2.patch --- nomacs-3.17.2282+dfsg/debian/patches/0003-allow-building-with-exiv2.patch 1970-01-01 01:00:00.000000000 +0100 +++ nomacs-3.17.2282+dfsg/debian/patches/0003-allow-building-with-exiv2.patch 2024-11-03 12:51:33.000000000 +0000 @@ -0,0 +1,48 @@ +Description: Allow builing with Exiv2 0.28.0 + +Origin: upstream, https://github.com/nomacs/nomacs/commit/247ff3c5140e414a180f3b27d2bcf9791131e0cd +Bug-Debian: https://bugs.debian.org/1081086 +Last-Update: 2024-11-03 +--- + +--- nomacs-3.17.2282+dfsg.orig/ImageLounge/src/DkCore/DkMetaData.cpp ++++ nomacs-3.17.2282+dfsg/ImageLounge/src/DkCore/DkMetaData.cpp +@@ -69,8 +69,7 @@ QSharedPointer DkMetaDataT: + // ImageFactory::create(type) may crash even if old Image object has that type + try { + // Load new Exiv2::Image object +- int i_type = mExifImg->imageType(); +- metaDataN->mExifImg = Exiv2::ImageFactory::create(i_type); ++ metaDataN->mExifImg = Exiv2::ImageFactory::create(mExifImg->imageType()); + // Copy exif data from old object into new object + Exiv2::ExifData data = mExifImg->exifData(); + metaDataN->mExifImg->setExifData(data); // explicit copy of list +@@ -243,9 +242,13 @@ bool DkMetaDataT::saveMetaData(QSharedPo + // Copy image + new exif and return temporary object as byte array + // The calling function should then write it back to the file + Exiv2::DataBuf exifBuf = exifImgN->io().read((long)exifImgN->io().size()); ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ if (!exifBuf.empty()) { ++ QSharedPointer tmp = QSharedPointer(new QByteArray(reinterpret_cast(exifBuf.c_data()), exifBuf.size())); ++#else + if (exifBuf.pData_) { +- QSharedPointer tmp = QSharedPointer(new QByteArray((const char *)exifBuf.pData_, exifBuf.size_)); +- ++ QSharedPointer tmp = QSharedPointer(new QByteArray(reinterpret_cast(exifBuf.pData_), exifBuf.size_)); ++#endif + if (tmp->size() > qRound(ba->size() * 0.5f)) + ba = tmp; + else +@@ -712,7 +715,11 @@ QImage DkMetaDataT::getThumbnail() const + Exiv2::ExifThumb thumb(exifData); + Exiv2::DataBuf buffer = thumb.copy(); + +- QByteArray ba = QByteArray((char *)buffer.pData_, buffer.size_); ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ QByteArray ba = QByteArray(reinterpret_cast(buffer.c_data()), buffer.size()); ++#else ++ QByteArray ba = QByteArray(reinterpret_cast(buffer.pData_), buffer.size_); ++#endif + qThumb.loadFromData(ba); + } catch (...) { + qDebug() << "Sorry, I could not load the thumb from the exif data..."; diff -Nru nomacs-3.17.2282+dfsg/debian/patches/series nomacs-3.17.2282+dfsg/debian/patches/series --- nomacs-3.17.2282+dfsg/debian/patches/series 2023-09-05 19:45:42.000000000 +0100 +++ nomacs-3.17.2282+dfsg/debian/patches/series 2024-11-03 12:51:33.000000000 +0000 @@ -1 +1,3 @@ 0001-Return-dummy-treeish-in-git_tag.patch +0002-avoid-autoptr.patch +0003-allow-building-with-exiv2.patch