From nobody Sun Jul 09 22:09:39 2023 X-Original-To: dev-commits-ports-main@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 4QzhBX5wp6z4mqZk; Sun, 9 Jul 2023 22:09:40 +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 4QzhBX0bxVz3CSr; Sun, 9 Jul 2023 22:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688940580; 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=H4L+tTChXpa9UgA5TZd6WS9OIGU4dhzDzf9L70mRjbI=; b=oe7lJYbWjqAW7wOMtBAYmLI0PV1lnEBMhlOjUnFh4y+hqu204oHKhrnJNI6UL9Cyv3rtEq gRKB97cCU1ngqN3NlinVEnoYICU8lxOE3ST307Z+JXq4WmzTNS57aQI4WogzbMHtFr02Iw jFMCRFsz6vsI0gn/3Z95zEc330YM6pdUwd4iAk044UUevHXxvF3vECupN4Yeieuj+JV4k7 HU328pVZ3qotm6PYEWjdjVqRTPBfpeUk7QijU/ouMJ7L2vTUIL1VTUTdGPM+ugHaLJAOYg BFqXUahpRE46/2/eMNapG0PtSFtYkynHDtZ+/IhiaFJqrabC2VoES/NQRQSV7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688940580; 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=H4L+tTChXpa9UgA5TZd6WS9OIGU4dhzDzf9L70mRjbI=; b=cUEkNN7VFOMmNn8Z0u2zH4myRx22Ggi6alhcyZzdE9GKRn7p2ew1yoeB/2to/EyQ/QiY9B ARUnWF29ZK3MNM5k0gRsdoZnJQjy56tg0MxVxIUDNB3h+EBY+9POtegSkZL73fMOVgZ8Jp ZbD58Cvbw0ADQYLE0VE8NGq6UNXPO9TRX6yxNzt97TUYJruUx8nMFVYOyJt0KAdsgDbyws EMjdUzrL6gqh1fiyufybyS5l09rbt3aZzkZ4YRfXci4SJU5/tqnCcrTlTb3gJNX3oDLJYM Cdd799hvJkMzzojQi2X0Jnuy0HZOUIsU/MufDw+tIGr4S78/Qwc+XcVeBu2T/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688940580; a=rsa-sha256; cv=none; b=YgWL5ej/8Yzv057xoqr4JTkunkhKlyp4VsDqsCcGJ7mysIU1q4Zc5TgiGShgeo/pIbrICV cyt+BBhu5vCpFE3SZcVet47Tv4m7M8lI1NDevxk6vPyAsNsh+GoSz+CQ8JVB1pMckpaNGq AYQ1hhIIAGI7fSmDR+3lo9JSi73s6r7D/dHejZRleMvp56rsHgRyDSLGBbRPL3coehdrz+ pWiiOUmaGV2DmWmtQA4cSJmmTn7kDb+NIyjtBbG+w6Nu9sCu52E6qeu99KbWxvHOs21iJX tsHr9z+qqQ0WDX3ln2gkNl5JuF2JFazkvXb11KarJfnpDPkZiv5YFpVJDNGFtw== 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 4QzhBW6nHRzKRr; Sun, 9 Jul 2023 22:09:39 +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 369M9d6e034282; Sun, 9 Jul 2023 22:09:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 369M9d2O034281; Sun, 9 Jul 2023 22:09:39 GMT (envelope-from git) Date: Sun, 9 Jul 2023 22:09:39 GMT Message-Id: <202307092209.369M9d2O034281@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: f858ee546f4f - main - graphics/krita: make compatible with exiv2 0.28 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: f858ee546f4f41478867fce862496935fdfe723b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=f858ee546f4f41478867fce862496935fdfe723b commit f858ee546f4f41478867fce862496935fdfe723b Author: Matthias Andree AuthorDate: 2023-07-02 13:35:32 +0000 Commit: Matthias Andree CommitDate: 2023-07-09 22:08:09 +0000 graphics/krita: make compatible with exiv2 0.28 Obtained from: https://invent.kde.org/graphics/krita/-/commits/64382cb061e622211e0f96a1a88f649084c95911 PR: 272311 --- graphics/krita/Makefile | 2 +- graphics/krita/files/patch-git-exiv2-a-e7bf1f0d299 | 582 +++++++++++++++++++++ 2 files changed, 583 insertions(+), 1 deletion(-) diff --git a/graphics/krita/Makefile b/graphics/krita/Makefile index 316aaa53cf76..5bc4cf1a2c4e 100644 --- a/graphics/krita/Makefile +++ b/graphics/krita/Makefile @@ -1,6 +1,6 @@ PORTNAME= krita DISTVERSION= 5.1.5 -PORTREVISION= 13 +PORTREVISION= 14 CATEGORIES= graphics kde MASTER_SITES= KDE/stable/${PORTNAME}/${DISTVERSION} DIST_SUBDIR= KDE/${PORTNAME} diff --git a/graphics/krita/files/patch-git-exiv2-a-e7bf1f0d299 b/graphics/krita/files/patch-git-exiv2-a-e7bf1f0d299 new file mode 100644 index 000000000000..9727deba37d4 --- /dev/null +++ b/graphics/krita/files/patch-git-exiv2-a-e7bf1f0d299 @@ -0,0 +1,582 @@ +From e7bf1f0d299c4f7c6529438059d14e7a99907066 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas +Date: Sun, 4 Jun 2023 18:04:59 +0200 +Subject: [PATCH] Fix build with exiv2 0.28 + +--- + plugins/impex/jpeg/kis_jpeg_converter.cc | 8 ++ + plugins/impex/tiff/kis_tiff_export.cc | 9 +++ + plugins/impex/tiff/kis_tiff_import.cc | 9 +++ + plugins/metadata/common/KisExiv2IODevice.cpp | 36 +++++++++ + plugins/metadata/common/KisExiv2IODevice.h | 23 ++++++ + plugins/metadata/common/kis_exiv2_common.h | 20 +++++ + plugins/metadata/exif/kis_exif_io.cpp | 79 +++++++++++++++++++- + plugins/metadata/iptc/kis_iptc_io.cpp | 12 +++ + plugins/metadata/xmp/kis_xmp_io.cpp | 9 ++- + 9 files changed, 200 insertions(+), 5 deletions(-) + +diff --git ./plugins/impex/jpeg/kis_jpeg_converter.cc ./plugins/impex/jpeg/kis_jpeg_converter.cc +index 3364ae6eda7..476151e1234 100644 +--- ./plugins/impex/jpeg/kis_jpeg_converter.cc ++++ ./plugins/impex/jpeg/kis_jpeg_converter.cc +@@ -20,6 +20,10 @@ extern "C" { + } + + #include ++#include ++#if EXIV2_TEST_VERSION(0,28,0) ++#include ++#endif + + #include + #include +@@ -376,7 +380,11 @@ KisImportExportErrorCode KisJPEGConverter::decode(QIODevice *io) + uint32_t sizeHdr = 0; + // Find actual Iptc data within the APP13 segment + if (!Exiv2::Photoshop::locateIptcIrb((Exiv2::byte*)(marker->data + 14), ++#if EXIV2_TEST_VERSION(0,28,0) ++ marker->data_length - 14, &record, sizeHdr, sizeIptc)) { ++#else + marker->data_length - 14, &record, &sizeHdr, &sizeIptc)) { ++#endif + if (sizeIptc) { + // Decode the IPTC data + QByteArray byteArray((const char*)(record + sizeHdr), sizeIptc); +diff --git ./plugins/impex/tiff/kis_tiff_export.cc ./plugins/impex/tiff/kis_tiff_export.cc +index 8c8f71d7c08..69cbda63033 100644 +--- ./plugins/impex/tiff/kis_tiff_export.cc ++++ ./plugins/impex/tiff/kis_tiff_export.cc +@@ -206,7 +206,11 @@ KisImportExportErrorCode KisTIFFExport::convert(KisDocument *document, QIODevice + try { + KisExiv2IODevice::ptr_type basicIoDevice(new KisExiv2IODevice(filename())); + ++#if EXIV2_TEST_VERSION(0,28,0) ++ const std::unique_ptr img = Exiv2::ImageFactory::open(std::move(basicIoDevice)); ++#else + const std::unique_ptr img(Exiv2::ImageFactory::open(basicIoDevice).release()); ++#endif + + img->readMetadata(); + +@@ -241,9 +245,14 @@ KisImportExportErrorCode KisTIFFExport::convert(KisDocument *document, QIODevice + } + // Write metadata + img->writeMetadata(); ++#if EXIV2_TEST_VERSION(0,28,0) ++ } catch (Exiv2::Error &e) { ++ errFile << "Failed injecting TIFF metadata:" << Exiv2::Error(e.code()).what(); ++#else + } catch (Exiv2::AnyError &e) { + errFile << "Failed injecting TIFF metadata:" << e.code() + << e.what(); ++#endif + } + } + return ImportExportCodes::OK; +diff --git ./plugins/impex/tiff/kis_tiff_import.cc ./plugins/impex/tiff/kis_tiff_import.cc +index e6d408e923b..5be62bbbf51 100644 +--- ./plugins/impex/tiff/kis_tiff_import.cc ++++ ./plugins/impex/tiff/kis_tiff_import.cc +@@ -1842,7 +1842,11 @@ KisTIFFImport::convert(KisDocument *document, + try { + KisExiv2IODevice::ptr_type basicIoDevice(new KisExiv2IODevice(filename())); + ++#if EXIV2_TEST_VERSION(0,28,0) ++ const std::unique_ptr readImg = Exiv2::ImageFactory::open(std::move(basicIoDevice)); ++#else + const std::unique_ptr readImg(Exiv2::ImageFactory::open(basicIoDevice).release()); ++#endif + + readImg->readMetadata(); + +@@ -1910,8 +1914,13 @@ KisTIFFImport::convert(KisDocument *document, + + // Inject the data as any other IOBackend + io->loadFrom(layer->metaData(), &ioDevice); ++#if EXIV2_TEST_VERSION(0,28,0) ++ } catch (Exiv2::Error &e) { ++ errFile << "Failed metadata import:" << Exiv2::Error(e.code()).what(); ++#else + } catch (Exiv2::AnyError &e) { + errFile << "Failed metadata import:" << e.code() << e.what(); ++#endif + } + } + +diff --git ./plugins/metadata/common/KisExiv2IODevice.cpp ./plugins/metadata/common/KisExiv2IODevice.cpp +index c62e2d15ae9..bf5cdc2bd63 100644 +--- ./plugins/metadata/common/KisExiv2IODevice.cpp ++++ ./plugins/metadata/common/KisExiv2IODevice.cpp +@@ -39,7 +39,11 @@ int KisExiv2IODevice::close() + return 0; + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++size_t KisExiv2IODevice::write(const Exiv2::byte *data, size_t wcount) ++#else + long KisExiv2IODevice::write(const Exiv2::byte *data, long wcount) ++#endif + { + if (!m_file.isWritable()) { + qWarning() << "KisExiv2IODevice: File not open for writing."; +@@ -53,7 +57,11 @@ long KisExiv2IODevice::write(const Exiv2::byte *data, long wcount) + return 0; + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++size_t KisExiv2IODevice::write(Exiv2::BasicIo &src) ++#else + long KisExiv2IODevice::write(Exiv2::BasicIo &src) ++#endif + { + if (static_cast(this) == &src) { + return 0; +@@ -88,15 +96,28 @@ int KisExiv2IODevice::putb(Exiv2::byte data) + } + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++Exiv2::DataBuf KisExiv2IODevice::read(size_t rcount) ++#else + Exiv2::DataBuf KisExiv2IODevice::read(long rcount) ++#endif + { + Exiv2::DataBuf buf(rcount); ++#if EXIV2_TEST_VERSION(0,28,0) ++ const size_t readCount = read(buf.data(), buf.size()); ++ buf.resize(readCount); ++#else + const long readCount = read(buf.pData_, buf.size_); + buf.size_ = readCount; ++#endif + return buf; + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++size_t KisExiv2IODevice::read(Exiv2::byte *buf, size_t rcount) ++#else + long KisExiv2IODevice::read(Exiv2::byte *buf, long rcount) ++#endif + { + const qint64 bytesRead = m_file.read(reinterpret_cast(buf), rcount); + if (bytesRead > 0) { +@@ -202,7 +223,18 @@ int KisExiv2IODevice::munmap() + return 0; + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++void KisExiv2IODevice::populateFakeData() ++{ ++ return; ++} ++#endif ++ ++#if EXIV2_TEST_VERSION(0,28,0) ++size_t KisExiv2IODevice::tell() const ++#else + long KisExiv2IODevice::tell() const ++#endif + { + return m_file.pos(); + } +@@ -231,7 +263,11 @@ bool KisExiv2IODevice::eof() const + return m_file.atEnd(); + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++const std::string& KisExiv2IODevice::path() const noexcept ++#else + std::string KisExiv2IODevice::path() const ++#endif + { + return filePathQString().toStdString(); + } +diff --git ./plugins/metadata/common/KisExiv2IODevice.h ./plugins/metadata/common/KisExiv2IODevice.h +index d90831e8325..27f5f8d5fc4 100644 +--- ./plugins/metadata/common/KisExiv2IODevice.h ++++ ./plugins/metadata/common/KisExiv2IODevice.h +@@ -18,18 +18,30 @@ + class KRITAEXIFCOMMON_EXPORT KisExiv2IODevice : public Exiv2::BasicIo + { + public: ++#if EXIV2_TEST_VERSION(0,28,0) ++ using ptr_type = Exiv2::BasicIo::UniquePtr; ++#else + using ptr_type = Exiv2::BasicIo::AutoPtr; ++#endif + + KisExiv2IODevice(QString path); + ~KisExiv2IODevice() override; + + int open() override; + int close() override; ++#if EXIV2_TEST_VERSION(0,28,0) ++ size_t write(const Exiv2::byte *data, size_t wcount) override; ++ size_t write(Exiv2::BasicIo &src) override; ++ int putb(Exiv2::byte data) override; ++ Exiv2::DataBuf read(size_t rcount) override; ++ size_t read(Exiv2::byte *buf, size_t rcount) override; ++#else + long write(const Exiv2::byte *data, long wcount) override; + long write(Exiv2::BasicIo &src) override; + int putb(Exiv2::byte data) override; + Exiv2::DataBuf read(long rcount) override; + long read(Exiv2::byte *buf, long rcount) override; ++#endif + int getb() override; + void transfer(BasicIo &src) override; + #if defined(_MSC_VER) +@@ -39,13 +51,24 @@ public: + #endif + + Exiv2::byte *mmap(bool isWriteable = false) override; ++#if EXIV2_TEST_VERSION(0,28,0) ++ void populateFakeData() override; ++#endif + int munmap() override; ++#if EXIV2_TEST_VERSION(0,28,0) ++ size_t tell() const override; ++#else + long tell() const override; ++#endif + size_t size() const override; + bool isopen() const override; + int error() const override; + bool eof() const override; ++#if EXIV2_TEST_VERSION(0,28,0) ++ const std::string& path() const noexcept override; ++#else + std::string path() const override; ++#endif + + private: + bool open(QFile::OpenMode mode); +--- ./plugins/metadata/common/kis_exiv2_common.h ++++ ./plugins/metadata/common/kis_exiv2_common.h +@@ -19,9 +19,13 @@ + + // Convert an exiv value to a KisMetaData value + inline KisMetaData::Value ++#if EXIV2_TEST_VERSION(0,28,0) ++exivValueToKMDValue(const Exiv2::Value::UniquePtr &value, bool forceSeq, KisMetaData::Value::ValueType arrayType = KisMetaData::Value::UnorderedArray) ++#else + exivValueToKMDValue(const Exiv2::Value::AutoPtr value, + bool forceSeq, + KisMetaData::Value::ValueType arrayType = KisMetaData::Value::UnorderedArray) ++#endif + { + switch (value->typeId()) { + case Exiv2::signedByte: +@@ -42,11 +46,19 @@ + case Exiv2::signedShort: + case Exiv2::signedLong: { + if (value->count() == 1 && !forceSeq) { ++#if EXIV2_TEST_VERSION(0,28,0) ++ return {static_cast(value->toUint32())}; ++#else + return KisMetaData::Value((int)value->toLong()); ++#endif + } else { + QList array; + for (int i = 0; i < value->count(); i++) ++#if EXIV2_TEST_VERSION(0,28,0) ++ array.push_back({static_cast(value->toUint32(i))}); ++#else + array.push_back(KisMetaData::Value((int)value->toLong(i))); ++#endif + return KisMetaData::Value(array, arrayType); + } + } +@@ -63,7 +75,11 @@ + return {KisMetaData::Rational(value->toRational().first, value->toRational().second)}; + } else { + QList array; ++#if EXIV2_TEST_VERSION(0,28,0) ++ for (size_t i = 0; i < value->count(); i++) { ++#else + for (long i = 0; i < value->count(); i++) { ++#endif + array.push_back(KisMetaData::Rational(value->toRational(i).first, value->toRational(i).second)); + } + return KisMetaData::Value(array, arrayType); +@@ -77,7 +93,11 @@ + return KisMetaData::Value(KisMetaData::Rational(value->toRational().first, value->toRational().second)); + } else { + QList array; ++#if EXIV2_TEST_VERSION(0,28,0) ++ for (size_t i = 0; i < value->count(); i++) { ++#else + for (long i = 0; i < value->count(); i++) { ++#endif + array.push_back(KisMetaData::Rational(value->toRational(i).first, value->toRational(i).second)); + } + return KisMetaData::Value(array, arrayType); +diff --git ./plugins/metadata/exif/kis_exif_io.cpp ./plugins/metadata/exif/kis_exif_io.cpp +index a3ee6927fca..a3b903afcb5 100644 +--- ./plugins/metadata/exif/kis_exif_io.cpp ++++ ./plugins/metadata/exif/kis_exif_io.cpp +@@ -31,7 +31,11 @@ + // ---- Exception conversion functions ---- // + + // convert ExifVersion and FlashpixVersion to a KisMetaData value ++#if EXIV2_TEST_VERSION(0,28,0) ++KisMetaData::Value exifVersionToKMDValue(const Exiv2::Value::UniquePtr value) ++#else + KisMetaData::Value exifVersionToKMDValue(const Exiv2::Value::AutoPtr value) ++#endif + { + const Exiv2::DataValue *dvalue = dynamic_cast(&*value); + if (dvalue) { +@@ -55,13 +59,22 @@ Exiv2::Value *kmdValueToExifVersion(const KisMetaData::Value &value) + } + + // Convert an exif array of integer string to a KisMetaData array of integer ++#if EXIV2_TEST_VERSION(0,28,0) ++KisMetaData::Value exifArrayToKMDIntOrderedArray(const Exiv2::Value::UniquePtr value) ++#else + KisMetaData::Value exifArrayToKMDIntOrderedArray(const Exiv2::Value::AutoPtr value) ++#endif + { + QList v; + const Exiv2::DataValue *dvalue = dynamic_cast(&*value); + if (dvalue) { ++#if EXIV2_TEST_VERSION(0,28,0) ++ for (size_t i = 0; i < dvalue->count(); i++) { ++ v.push_back({(int)dvalue->toUint32(i)}); ++#else + for (long i = 0; i < dvalue->count(); i++) { + v.push_back({(int)dvalue->toLong(i)}); ++#endif + } + } else { + Q_ASSERT(value->typeId() == Exiv2::asciiString); +@@ -81,7 +94,11 @@ Exiv2::Value *kmdIntOrderedArrayToExifArray(const KisMetaData::Value &value) + return new Exiv2::DataValue(v.data(), static_cast(v.size())); + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++QDateTime exivValueToDateTime(const Exiv2::Value::UniquePtr value) ++#else + QDateTime exivValueToDateTime(const Exiv2::Value::AutoPtr value) ++#endif + { + return QDateTime::fromString(value->toString().c_str(), Qt::ISODate); + } +@@ -115,7 +132,11 @@ Exiv2::ByteOrder invertByteOrder(Exiv2::ByteOrder order) + return Exiv2::invalidByteOrder; + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++KisMetaData::Value exifOECFToKMDOECFStructure(const Exiv2::Value::UniquePtr value, Exiv2::ByteOrder order) ++#else + KisMetaData::Value exifOECFToKMDOECFStructure(const Exiv2::Value::AutoPtr value, Exiv2::ByteOrder order) ++#endif + { + QMap oecfStructure; + const Exiv2::DataValue *dvalue = dynamic_cast(&*value); +@@ -123,22 +144,39 @@ KisMetaData::Value exifOECFToKMDOECFStructure(const Exiv2::Value::AutoPtr value, + QByteArray array(dvalue->count(), 0); + + dvalue->copy((Exiv2::byte *)array.data()); ++#if EXIV2_TEST_VERSION(0,28,0) ++ size_t columns = fixEndianess((reinterpret_cast(array.data()))[0], order); ++ size_t rows = fixEndianess((reinterpret_cast(array.data()))[1], order); ++#else + int columns = fixEndianess((reinterpret_cast(array.data()))[0], order); + int rows = fixEndianess((reinterpret_cast(array.data()))[1], order); ++#endif + + if ((columns * rows + 4) + > dvalue->count()) { // Sometime byteOrder get messed up (especially if metadata got saved with kexiv2 library, + // or any library that doesn't save back with the same byte order as the camera) + order = invertByteOrder(order); ++#if EXIV2_TEST_VERSION(0,28,0) ++ columns = fixEndianess((reinterpret_cast(array.data()))[0], order); ++ rows = fixEndianess((reinterpret_cast(array.data()))[1], order); ++#else + columns = fixEndianess((reinterpret_cast(array.data()))[0], order); + rows = fixEndianess((reinterpret_cast(array.data()))[1], order); ++#endif + Q_ASSERT((columns * rows + 4) > dvalue->count()); + } +- oecfStructure["Columns"] = KisMetaData::Value(columns); +- oecfStructure["Rows"] = KisMetaData::Value(rows); ++ QVariant qcolumns, qrows; ++ qcolumns.setValue(columns); ++ qrows.setValue(rows); ++ oecfStructure["Columns"] = KisMetaData::Value(qcolumns); ++ oecfStructure["Rows"] = KisMetaData::Value(qrows); + int index = 4; + QList names; ++#if EXIV2_TEST_VERSION(0,28,0) ++ for (size_t i = 0; i < columns; i++) { ++#else + for (int i = 0; i < columns; i++) { ++#endif + int lastIndex = array.indexOf((char)0, index); + QString name = array.mid(index, lastIndex - index); + if (index != lastIndex) { +@@ -153,8 +191,13 @@ KisMetaData::Value exifOECFToKMDOECFStructure(const Exiv2::Value::AutoPtr value, + oecfStructure["Names"] = KisMetaData::Value(names, KisMetaData::Value::OrderedArray); + QList values; + qint32 *dataIt = reinterpret_cast(array.data() + index); ++#if EXIV2_TEST_VERSION(0,28,0) ++ for (size_t i = 0; i < columns; i++) { ++ for (size_t j = 0; j < rows; j++) { ++#else + for (int i = 0; i < columns; i++) { + for (int j = 0; j < rows; j++) { ++#endif + values.append(KisMetaData::Value( + KisMetaData::Rational(fixEndianess(dataIt[0], order), fixEndianess(dataIt[1], order)))); + dataIt += 2; +@@ -202,7 +245,11 @@ Exiv2::Value *kmdOECFStructureToExifOECF(const KisMetaData::Value &value) + return new Exiv2::DataValue((const Exiv2::byte *)array.data(), array.size()); + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++KisMetaData::Value deviceSettingDescriptionExifToKMD(const Exiv2::Value::UniquePtr value) ++#else + KisMetaData::Value deviceSettingDescriptionExifToKMD(const Exiv2::Value::AutoPtr value) ++#endif + { + QMap deviceSettingStructure; + QByteArray array; +@@ -258,15 +305,24 @@ Exiv2::Value *deviceSettingDescriptionKMDToExif(const KisMetaData::Value &value) + return new Exiv2::DataValue((const Exiv2::byte *)array.data(), array.size()); + } + ++#if EXIV2_TEST_VERSION(0,28,0) ++KisMetaData::Value cfaPatternExifToKMD(const Exiv2::Value::UniquePtr value, Exiv2::ByteOrder order) ++#else + KisMetaData::Value cfaPatternExifToKMD(const Exiv2::Value::AutoPtr value, Exiv2::ByteOrder order) ++#endif + { + QMap cfaPatternStructure; + const Exiv2::DataValue *dvalue = dynamic_cast(&*value); + Q_ASSERT(dvalue); + QByteArray array(dvalue->count(), 0); + dvalue->copy((Exiv2::byte *)array.data()); ++#if EXIV2_TEST_VERSION(0,28,0) ++ size_t columns = fixEndianess((reinterpret_cast(array.data()))[0], order); ++ size_t rows = fixEndianess((reinterpret_cast(array.data()))[1], order); ++#else + int columns = fixEndianess((reinterpret_cast(array.data()))[0], order); + int rows = fixEndianess((reinterpret_cast(array.data()))[1], order); ++#endif + if ((columns * rows + 4) + != dvalue->count()) { // Sometime byteOrder get messed up (especially if metadata got saved with kexiv2 library, + // or any library that doesn't save back with the same byte order as the camera) +@@ -275,8 +331,11 @@ KisMetaData::Value cfaPatternExifToKMD(const Exiv2::Value::AutoPtr value, Exiv2: + rows = fixEndianess((reinterpret_cast(array.data()))[1], order); + Q_ASSERT((columns * rows + 4) == dvalue->count()); + } +- cfaPatternStructure["Columns"] = KisMetaData::Value(columns); +- cfaPatternStructure["Rows"] = KisMetaData::Value(rows); ++ QVariant qcolumns, qrows; ++ qcolumns.setValue(columns); ++ qrows.setValue(rows); ++ cfaPatternStructure["Columns"] = KisMetaData::Value(qcolumns); ++ cfaPatternStructure["Rows"] = KisMetaData::Value(qrows); + QList values; + int index = 4; + for (int i = 0; i < columns * rows; i++) { +@@ -310,9 +369,17 @@ Exiv2::Value *cfaPatternKMDToExif(const KisMetaData::Value &value) + + // Read and write Flash // + ++#if EXIV2_TEST_VERSION(0,28,0) ++KisMetaData::Value flashExifToKMD(const Exiv2::Value::UniquePtr value) ++#else + KisMetaData::Value flashExifToKMD(const Exiv2::Value::AutoPtr value) ++#endif + { ++#if EXIV2_TEST_VERSION(0,28,0) ++ const uint16_t v = static_cast(value->toUint32()); ++#else + const uint16_t v = static_cast(value->toLong()); ++#endif + QMap flashStructure; + bool fired = (v & 0x01); // bit 1 is whether flash was fired or not + flashStructure["Fired"] = QVariant(fired); +@@ -465,7 +532,11 @@ bool KisExifIO::saveTo(const KisMetaData::Store *store, QIODevice *ioDevice, Hea + << exivKey; // << " of KMD value" << entry.value(); + } + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ } catch (Exiv2::Error &e) { ++#else + } catch (Exiv2::AnyError &e) { ++#endif + dbgMetaData << "exiv error " << e.what(); + } + } +diff --git ./plugins/metadata/iptc/kis_iptc_io.cpp ./plugins/metadata/iptc/kis_iptc_io.cpp +index 9e85624644d..88d80b38b8d 100644 +--- ./plugins/metadata/iptc/kis_iptc_io.cpp ++++ ./plugins/metadata/iptc/kis_iptc_io.cpp +@@ -109,7 +109,11 @@ bool KisIptcIO::saveTo(const KisMetaData::Store *store, QIODevice *ioDevice, Hea + if (v && v->typeId() != Exiv2::invalidTypeId) { + iptcData.add(iptcKey, v); + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ } catch (Exiv2::Error &e) { ++#else + } catch (Exiv2::AnyError &e) { ++#endif + dbgMetaData << "exiv error " << e.what(); + } + } +@@ -127,7 +131,11 @@ bool KisIptcIO::saveTo(const KisMetaData::Store *store, QIODevice *ioDevice, Hea + header.append(photoshopBimId_); + header.append(photoshopIptc_); + header.append(QByteArray(2, 0)); ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ qint32 size = rawData.size(); ++#else + qint32 size = rawData.size_; ++#endif + QByteArray sizeArray(4, 0); + sizeArray[0] = (char)((size & 0xff000000) >> 24); + sizeArray[1] = (char)((size & 0x00ff0000) >> 16); +@@ -137,7 +145,11 @@ bool KisIptcIO::saveTo(const KisMetaData::Store *store, QIODevice *ioDevice, Hea + ioDevice->write(header); + } + ++#if EXIV2_TEST_VERSION(0, 28, 0) ++ ioDevice->write((const char *)rawData.data(), rawData.size()); ++#else + ioDevice->write((const char *)rawData.pData_, rawData.size_); ++#endif + ioDevice->close(); + return true; + } +diff --git ./plugins/metadata/xmp/kis_xmp_io.cpp ./plugins/metadata/xmp/kis_xmp_io.cpp +index a1003175455..927abe8dddf 100644 +--- ./plugins/metadata/xmp/kis_xmp_io.cpp ++++ ./plugins/metadata/xmp/kis_xmp_io.cpp +@@ -249,8 +249,11 @@ bool KisXMPIO::loadFrom(KisMetaData::Store *store, QIODevice *ioDevice) const + Q_ASSERT(schema); + } + } ++#if EXIV2_TEST_VERSION(0,28,0) ++ const Exiv2::Value::UniquePtr value = it->getValue(); ++#else + const Exiv2::Value::AutoPtr value = it->getValue(); +- ++#endif + QString structName; + int arrayIndex = -1; + QString tagName; +@@ -279,7 +282,11 @@ bool KisXMPIO::loadFrom(KisMetaData::Store *store, QIODevice *ioDevice) const + const Exiv2::XmpArrayValue *xav = dynamic_cast(value.get()); + Q_ASSERT(xav); + QList array; ++#if EXIV2_TEST_VERSION(0,28,0) ++ for (size_t i = 0; i < xav->count(); ++i) { ++#else + for (int i = 0; i < xav->count(); ++i) { ++#endif + QString value = QString::fromStdString(xav->toString(i)); + if (parser) { + array.push_back(parser->parse(value));