SHA256
1
0
forked from pool/krita

Accepting request 1116710 from KDE:Extra

Update to 5.2.0

OBS-URL: https://build.opensuse.org/request/show/1116710
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/krita?expand=0&rev=71
This commit is contained in:
Ana Guerrero 2023-10-11 21:54:23 +00:00 committed by Git OBS Bridge
commit ec46cd44ae
8 changed files with 58 additions and 664 deletions

View File

@ -1,589 +0,0 @@
From 4a9a916012b949c9dda6833e4e44e932d38993d4 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
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 | 26 ++++++-
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, 202 insertions(+), 9 deletions(-)
diff --git a/plugins/impex/jpeg/kis_jpeg_converter.cc b/plugins/impex/jpeg/kis_jpeg_converter.cc
index 3364ae6..476151e 100644
--- a/plugins/impex/jpeg/kis_jpeg_converter.cc
+++ b/plugins/impex/jpeg/kis_jpeg_converter.cc
@@ -20,6 +20,10 @@ extern "C" {
}
#include <exiv2/jpgimage.hpp>
+#include <exiv2/version.hpp>
+#if EXIV2_TEST_VERSION(0,28,0)
+#include <exiv2/photoshop.hpp>
+#endif
#include <QFile>
#include <QBuffer>
@@ -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 a/plugins/impex/tiff/kis_tiff_export.cc b/plugins/impex/tiff/kis_tiff_export.cc
index 8c8f71d..69cbda6 100644
--- a/plugins/impex/tiff/kis_tiff_export.cc
+++ b/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<Exiv2::Image> img = Exiv2::ImageFactory::open(std::move(basicIoDevice));
+#else
const std::unique_ptr<Exiv2::Image> 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 a/plugins/impex/tiff/kis_tiff_import.cc b/plugins/impex/tiff/kis_tiff_import.cc
index 3845cc5..19b37d7 100644
--- a/plugins/impex/tiff/kis_tiff_import.cc
+++ b/plugins/impex/tiff/kis_tiff_import.cc
@@ -1840,7 +1840,11 @@ KisTIFFImport::convert(KisDocument *document,
try {
KisExiv2IODevice::ptr_type basicIoDevice(new KisExiv2IODevice(filename()));
+#if EXIV2_TEST_VERSION(0,28,0)
+ const std::unique_ptr<Exiv2::Image> readImg = Exiv2::ImageFactory::open(std::move(basicIoDevice));
+#else
const std::unique_ptr<Exiv2::Image> readImg(Exiv2::ImageFactory::open(basicIoDevice).release());
+#endif
readImg->readMetadata();
@@ -1908,8 +1912,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 a/plugins/metadata/common/KisExiv2IODevice.cpp b/plugins/metadata/common/KisExiv2IODevice.cpp
index c62e2d1..bf5cdc2 100644
--- a/plugins/metadata/common/KisExiv2IODevice.cpp
+++ b/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<BasicIo *>(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<char *>(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 a/plugins/metadata/common/KisExiv2IODevice.h b/plugins/metadata/common/KisExiv2IODevice.h
index d90831e..27f5f8d 100644
--- a/plugins/metadata/common/KisExiv2IODevice.h
+++ b/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);
diff --git a/plugins/metadata/common/kis_exiv2_common.h b/plugins/metadata/common/kis_exiv2_common.h
index 3ab34bb..b4912c7 100644
--- a/plugins/metadata/common/kis_exiv2_common.h
+++ b/plugins/metadata/common/kis_exiv2_common.h
@@ -19,9 +19,11 @@
// Convert an exiv value to a KisMetaData value
inline KisMetaData::Value
-exivValueToKMDValue(const Exiv2::Value::AutoPtr value,
- bool forceSeq,
- KisMetaData::Value::ValueType arrayType = KisMetaData::Value::UnorderedArray)
+#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 +44,19 @@ exivValueToKMDValue(const Exiv2::Value::AutoPtr value,
case Exiv2::signedShort:
case Exiv2::signedLong: {
if (value->count() == 1 && !forceSeq) {
- return KisMetaData::Value((int)value->toLong());
+#if EXIV2_TEST_VERSION(0,28,0)
+ return {static_cast<int>(value->toUint32())};
+#else
+ return {static_cast<int>(value->toLong())};
+#endif
} else {
QList<KisMetaData::Value> array;
for (int i = 0; i < value->count(); i++)
+#if EXIV2_TEST_VERSION(0,28,0)
+ array.push_back(KisMetaData::Value((int)value->toUint32(i)));
+#else
array.push_back(KisMetaData::Value((int)value->toLong(i)));
+#endif
return KisMetaData::Value(array, arrayType);
}
}
@@ -63,7 +73,11 @@ exivValueToKMDValue(const Exiv2::Value::AutoPtr value,
return {KisMetaData::Rational(value->toRational().first, value->toRational().second)};
} else {
QList<KisMetaData::Value> 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 +91,11 @@ exivValueToKMDValue(const Exiv2::Value::AutoPtr value,
return KisMetaData::Value(KisMetaData::Rational(value->toRational().first, value->toRational().second));
} else {
QList<KisMetaData::Value> 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 a/plugins/metadata/exif/kis_exif_io.cpp b/plugins/metadata/exif/kis_exif_io.cpp
index 4469712..6afdf75 100644
--- a/plugins/metadata/exif/kis_exif_io.cpp
+++ b/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<const Exiv2::DataValue *>(&*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<KisMetaData::Value> v;
const Exiv2::DataValue *dvalue = dynamic_cast<const Exiv2::DataValue *>(&*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<long>(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<QString, KisMetaData::Value> oecfStructure;
const Exiv2::DataValue *dvalue = dynamic_cast<const Exiv2::DataValue *>(&*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<qsizetype>((reinterpret_cast<qsizetype *>(array.data()))[0], order);
+ size_t rows = fixEndianess<qsizetype>((reinterpret_cast<qsizetype *>(array.data()))[1], order);
+#else
int columns = fixEndianess<quint16>((reinterpret_cast<quint16 *>(array.data()))[0], order);
int rows = fixEndianess<quint16>((reinterpret_cast<quint16 *>(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<qsizetype>((reinterpret_cast<qsizetype *>(array.data()))[0], order);
+ rows = fixEndianess<qsizetype>((reinterpret_cast<qsizetype *>(array.data()))[1], order);
+#else
columns = fixEndianess<quint16>((reinterpret_cast<quint16 *>(array.data()))[0], order);
rows = fixEndianess<quint16>((reinterpret_cast<quint16 *>(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<KisMetaData::Value> 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<KisMetaData::Value> values;
qint32 *dataIt = reinterpret_cast<qint32 *>(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<qint32>(dataIt[0], order), fixEndianess<qint32>(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<QString, KisMetaData::Value> 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<QString, KisMetaData::Value> cfaPatternStructure;
const Exiv2::DataValue *dvalue = dynamic_cast<const Exiv2::DataValue *>(&*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<qsizetype>((reinterpret_cast<qsizetype *>(array.data()))[0], order);
+ size_t rows = fixEndianess<qsizetype>((reinterpret_cast<qsizetype *>(array.data()))[1], order);
+#else
int columns = fixEndianess<quint16>((reinterpret_cast<quint16 *>(array.data()))[0], order);
int rows = fixEndianess<quint16>((reinterpret_cast<quint16 *>(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<quint16>((reinterpret_cast<quint16 *>(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<KisMetaData::Value> 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<uint16_t>(value->toUint32());
+#else
const uint16_t v = static_cast<uint16_t>(value->toLong());
+#endif
QMap<QString, KisMetaData::Value> 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(KisMetaData::Store *store, QIODevice *ioDevice, HeaderTyp
<< 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 a/plugins/metadata/iptc/kis_iptc_io.cpp b/plugins/metadata/iptc/kis_iptc_io.cpp
index 05f66ee..06f91ed 100644
--- a/plugins/metadata/iptc/kis_iptc_io.cpp
+++ b/plugins/metadata/iptc/kis_iptc_io.cpp
@@ -110,7 +110,11 @@ bool KisIptcIO::saveTo(KisMetaData::Store *store, QIODevice *ioDevice, HeaderTyp
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();
}
}
@@ -128,7 +132,11 @@ bool KisIptcIO::saveTo(KisMetaData::Store *store, QIODevice *ioDevice, HeaderTyp
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);
@@ -138,7 +146,11 @@ bool KisIptcIO::saveTo(KisMetaData::Store *store, QIODevice *ioDevice, HeaderTyp
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 a/plugins/metadata/xmp/kis_xmp_io.cpp b/plugins/metadata/xmp/kis_xmp_io.cpp
index 14990de..afb6aa9 100644
--- a/plugins/metadata/xmp/kis_xmp_io.cpp
+++ b/plugins/metadata/xmp/kis_xmp_io.cpp
@@ -248,8 +248,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;
@@ -278,7 +281,11 @@ bool KisXMPIO::loadFrom(KisMetaData::Store *store, QIODevice *ioDevice) const
const Exiv2::XmpArrayValue *xav = dynamic_cast<const Exiv2::XmpArrayValue *>(value.get());
Q_ASSERT(xav);
QList<KisMetaData::Value> 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));
--
2.41.0

View File

@ -1,45 +0,0 @@
From 92a643544928c056a1192cd903e0c6666fd2f8c9 Mon Sep 17 00:00:00 2001
From: psykose -- <alice@ayaya.dev>
Date: Thu, 15 Jun 2023 08:48:43 +0000
Subject: [PATCH] KisExiv2IoDevice: fix types on 32-bit host with exiv2 0.28
upstream commit
https://github.com/Exiv2/exiv2/commit/813566526c9ecdc92fc55c7a7d4de2d8e73e125a
now uses int64_t instead of long
this worked for 64-bit ILP64 since long was int64_t, but it does not
match on 32-bit platforms
---
plugins/metadata/common/KisExiv2IODevice.cpp | 2 +-
plugins/metadata/common/KisExiv2IODevice.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/metadata/common/KisExiv2IODevice.cpp b/plugins/metadata/common/KisExiv2IODevice.cpp
index bf5cdc2bd6..ed08543739 100644
--- a/plugins/metadata/common/KisExiv2IODevice.cpp
+++ b/plugins/metadata/common/KisExiv2IODevice.cpp
@@ -175,7 +175,7 @@ void KisExiv2IODevice::transfer(Exiv2::BasicIo &src)
}
}
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || EXIV2_TEST_VERSION(0,28,0)
int KisExiv2IODevice::seek(int64_t offset, Exiv2::BasicIo::Position position)
#else
int KisExiv2IODevice::seek(long offset, Exiv2::BasicIo::Position position)
diff --git a/plugins/metadata/common/KisExiv2IODevice.h b/plugins/metadata/common/KisExiv2IODevice.h
index 27f5f8d5fc..a72ae01f59 100644
--- a/plugins/metadata/common/KisExiv2IODevice.h
+++ b/plugins/metadata/common/KisExiv2IODevice.h
@@ -44,7 +44,7 @@ public:
#endif
int getb() override;
void transfer(BasicIo &src) override;
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || EXIV2_TEST_VERSION(0,28,0)
int seek(int64_t offset, Position pos) override;
#else
int seek(long offset, Position pos) override;
--
2.41.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:45eac209a3c4ac285ca223e1978d35694cdca31b0075e596ad252d6619f04249
size 184981952

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEBkGCRAxnTZ+ND2+LTaee2iMchSsFAmO21VEACgkQTaee2iMc
hSsU5RAA1p80t6m49VOtxS5BSE4WgwwX3BUAMLpxI4VpfeX6Zdps/YT2pzix764J
WY5ZzDC2mi1Yf8vEEocYTzyGjhw0L+96d6MpI8D0WPextT8jbgRhldT/Nyaq7Rir
RHRdg4ocT/B3aaNJROAxJS3imG5L7pOg3j5/S5n7978jBwcYpdtf2rawuY8f7pgw
q4t9eW1dUdQXqvLKtPsOeNtBOIDX72/DtRSe7KW9nelNIi42ZY3w6OlVXqj0d4k+
4+WXMXJVq8YLqLWmpr9pG6jSbf1jm/V6cVIvrWsypquXEewI+GWvVxXB6jnCE+2y
c+EHlVSVJPzvVkmLn/PSHvo0dEb4V///0pAayDEBZynsxjrMp0qh/IjLeZOx1Xh2
LawVpnzmgPbKvzmn7rXKAXQufTpfGL2ZLA6rfOV2nSx92FM9792lx6B93DplcdQI
/U/ZRQnAcjiUrO9GV7d92a12bIlHBhMcVfq3u6GTP/jwD+LqIv4wfJf6Zv3C4u+B
uUbFIMJYMjXXlYmkUAaD4u55IAdhQgRN9GLnaXL4xxhS386/U77lVqM1zJyxvgPZ
GzkvWGtP/4ebxvGrMj+5/YZtChXVDfq3ZXurKcs9PuUeTLx74c8F9QbqhKKHQC8z
TQ1mDdWs7YOivEbCFSDakjWdkMbvteA9Qa82+P0gbq1q425mP2A=
=pJYw
-----END PGP SIGNATURE-----

3
krita-5.2.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a3791a9cbb590d9964b45c0c1ed89c37d422e38606f70885f16de1ff2f645baf
size 188368484

16
krita-5.2.0.tar.xz.sig Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEBkGCRAxnTZ+ND2+LTaee2iMchSsFAmUdc+IACgkQTaee2iMc
hSs5jRAAwjbegbUBcQ5SrVoEOG4v5MmBGXFCugcuHuc+F8pZiFntV0jscPoxoEu8
rb6rv0F6G89I3lpdkt9REr2Bkqbw+s5XYbiYEVLgng71WIZ1slZjAduMMtBpVUQi
o+bi5sYZErduJ1nlk0Lz6rmo/wf3wx4Ryh8T7W2IYkastS8ZRwz7yqFKOQrLDx2s
C4xBivAolFWGt6FUMdtijcPZ9ANNDU5X2Nle+vkGaJoe6Vf9kYjGv1irPDIvcZCk
Ibdg3C5o9VkHpfFVxTdMeVRBu0bFXmMA9rYxsfpN9ojjbpm3PcEjNpyZzXNdWF7K
riMsDJnvgojS3tfqv3+xUNUunH9O6o7GOFd1GOBraZpJm7tQTrOiIdful5lMnKkq
y4+hTdCDLzn+yQ1eACgom0MGerw+iyF88MkoV2PdRkWfEvEgTQwuxz30ee4uSQNw
TAdVFniFymzM+9x/nYUAZsNJIOSZkbK/kgksu/IIXrozedEr25Su+RcXDoaRmS7B
tJvR3C4yLySWMChLUquq+FlHmVUS6R+88O01G4OKfjiN+p08OjgSJhsOTCJKixIC
RyeY8NYXbQASWjDC9qHzKQeMM1rdPD9EVoC62m3ESd5Zx2fPpz/sPKhPBmy+r2nb
07YJjvj1cvzxOUNuoSU2AaGT/6Wwu9cvH8S8+4tfDn40yh8aIq0=
=SWzu
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Oct 10 12:36:54 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 5.2.0
* https://krita.org/en/krita-5-2-release-notes/
- Drop patches, merged upstream:
* 0001-Fix-build-with-exiv2-0.28.patch
* 0001-KisExiv2IoDevice-fix-types-on-32-bit-host-with-exiv2.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jul 4 07:14:23 UTC 2023 - Christophe Marin <christophe@krop.fr> Tue Jul 4 07:14:23 UTC 2023 - Christophe Marin <christophe@krop.fr>

View File

@ -23,12 +23,16 @@
%bcond_without xsimd %bcond_without xsimd
%endif %endif
%endif %endif
# Default python version is too old in Leap 15
%if 0%{?suse_version} > 1500
%bcond_without python
%endif
# SR#1043861 for 15.5 # SR#1043861 for 15.5
%if 0%{?suse_version} > 1500 || (0%{?is_opensuse} && 0%{?sle_version} > 150400) %if 0%{?suse_version} > 1500 || (0%{?is_opensuse} && 0%{?sle_version} > 150400)
%bcond_without libjxl %bcond_without libjxl
%endif %endif
Name: krita Name: krita
Version: 5.1.5 Version: 5.2.0
Release: 0 Release: 0
Summary: Digital Painting Application Summary: Digital Painting Application
License: BSD-2-Clause AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-3.0-or-later AND CC0-1.0 AND LGPL-2.0-only License: BSD-2-Clause AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-3.0-or-later AND CC0-1.0 AND LGPL-2.0-only
@ -38,15 +42,11 @@ Source0: https://download.kde.org/stable/krita/%{version}/krita-%{version
Source1: https://download.kde.org/stable/krita/%{version}/krita-%{version}.tar.xz.sig Source1: https://download.kde.org/stable/krita/%{version}/krita-%{version}.tar.xz.sig
Source2: krita.keyring Source2: krita.keyring
%endif %endif
# Exiv 0.28 build fixes
Patch0: 0001-Fix-build-with-exiv2-0.28.patch
Patch1: 0001-KisExiv2IoDevice-fix-types-on-32-bit-host-with-exiv2.patch
BuildRequires: OpenEXR-devel BuildRequires: OpenEXR-devel
BuildRequires: extra-cmake-modules BuildRequires: extra-cmake-modules
BuildRequires: fftw3-devel BuildRequires: fftw3-devel
BuildRequires: giflib-devel BuildRequires: giflib-devel
BuildRequires: gsl-devel BuildRequires: gsl-devel
BuildRequires: kseexpr-devel
%if 0%{?suse_version} > 1500 %if 0%{?suse_version} > 1500
BuildRequires: libboost_system-devel BuildRequires: libboost_system-devel
%else %else
@ -65,37 +65,45 @@ BuildRequires: libtiff-devel
BuildRequires: openjpeg2-devel BuildRequires: openjpeg2-devel
BuildRequires: perl BuildRequires: perl
BuildRequires: pkgconfig BuildRequires: pkgconfig
%if %{with python}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-qt5-devel BuildRequires: python3-qt5-devel
BuildRequires: python3-sip-devel BuildRequires: python3-sip-devel
%endif
BuildRequires: update-desktop-files BuildRequires: update-desktop-files
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: cmake(KF5Archive) BuildRequires: cmake(Immer)
BuildRequires: cmake(KF5Completion) BuildRequires: cmake(KF5Completion)
BuildRequires: cmake(KF5Config) BuildRequires: cmake(KF5Config)
BuildRequires: cmake(KF5CoreAddons) BuildRequires: cmake(KF5CoreAddons)
BuildRequires: cmake(KF5Crash) BuildRequires: cmake(KF5Crash)
BuildRequires: cmake(KF5GuiAddons) BuildRequires: cmake(KF5GuiAddons)
BuildRequires: cmake(KF5I18n) BuildRequires: cmake(KF5I18n)
BuildRequires: cmake(KF5ItemModels)
BuildRequires: cmake(KF5ItemViews) BuildRequires: cmake(KF5ItemViews)
BuildRequires: cmake(KF5KDcraw)
BuildRequires: cmake(KF5WidgetsAddons) BuildRequires: cmake(KF5WidgetsAddons)
BuildRequires: cmake(KF5WindowSystem) BuildRequires: cmake(KF5WindowSystem)
BuildRequires: cmake(Lager)
BuildRequires: cmake(Mlt7)
BuildRequires: cmake(Qt5Concurrent) BuildRequires: cmake(Qt5Concurrent)
BuildRequires: cmake(Qt5Core) >= 5.9 BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5DBus) BuildRequires: cmake(Qt5DBus)
BuildRequires: cmake(Qt5Gui) BuildRequires: cmake(Qt5Gui)
BuildRequires: cmake(Qt5Multimedia)
BuildRequires: cmake(Qt5Network) BuildRequires: cmake(Qt5Network)
BuildRequires: cmake(Qt5PrintSupport) BuildRequires: cmake(Qt5PrintSupport)
BuildRequires: cmake(Qt5Qml) BuildRequires: cmake(Qt5Qml)
BuildRequires: cmake(Qt5Quick) BuildRequires: cmake(Qt5Quick)
BuildRequires: cmake(Qt5QuickWidgets)
BuildRequires: cmake(Qt5Sql)
BuildRequires: cmake(Qt5Svg) BuildRequires: cmake(Qt5Svg)
BuildRequires: cmake(Qt5Test) BuildRequires: cmake(Qt5Test)
BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5Widgets)
BuildRequires: cmake(Qt5X11Extras) BuildRequires: cmake(Qt5X11Extras)
BuildRequires: cmake(Qt5Xml) BuildRequires: cmake(Qt5Xml)
BuildRequires: cmake(QuaZip-Qt5) BuildRequires: cmake(QuaZip-Qt5)
BuildRequires: cmake(Zug)
BuildRequires: cmake(kseexpr)
BuildRequires: cmake(sdl2)
%if %{with xsimd} %if %{with xsimd}
BuildRequires: cmake(xsimd) BuildRequires: cmake(xsimd)
%endif %endif
@ -103,11 +111,19 @@ BuildRequires: pkgconfig(OpenColorIO)
%if %{with libjxl} %if %{with libjxl}
BuildRequires: pkgconfig(libjxl) BuildRequires: pkgconfig(libjxl)
%endif %endif
BuildRequires: pkgconfig(fontconfig) >= 2.13.1
BuildRequires: pkgconfig(freetype2) >= 2.10.0
BuildRequires: pkgconfig(fribidi) >= 1.0.6
BuildRequires: pkgconfig(harfbuzz) >= 4.0
BuildRequires: pkgconfig(libmypaint) BuildRequires: pkgconfig(libmypaint)
BuildRequires: pkgconfig(libunibreak)
BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(xcb-xinput)
BuildRequires: pkgconfig(xcb-atom) BuildRequires: pkgconfig(xcb-atom)
BuildRequires: pkgconfig(xi) >= 1.4.99.1 BuildRequires: pkgconfig(xi) >= 1.4.99.1
%if %{with python}
Recommends: python3-qt5 Recommends: python3-qt5
%endif
Obsoletes: calligra-krita < %{version} Obsoletes: calligra-krita < %{version}
Provides: calligra-krita = %{version} Provides: calligra-krita = %{version}
Recommends: krita-plugin-gmic Recommends: krita-plugin-gmic
@ -143,11 +159,12 @@ Development headers and libraries for Krita.
chmod -x %{buildroot}%{_kf5_applicationsdir}/*.desktop chmod -x %{buildroot}%{_kf5_applicationsdir}/*.desktop
%if %{with python}
# remove shebang to avoid rpmlint warning, that file is not supposed to be run directly anyway # remove shebang to avoid rpmlint warning, that file is not supposed to be run directly anyway
sed -i "/#!\/usr\/bin\/env/d" %{buildroot}%{_kf5_libdir}/krita-python-libs/krita/sceditor/highlighter.py sed -i "/#!\/usr\/bin\/env/d" %{buildroot}%{_kf5_libdir}/krita-python-libs/krita/sceditor/highlighter.py
%endif
%post -p /sbin/ldconfig %ldconfig_scriptlets
%postun -p /sbin/ldconfig
%files %files
%license COPYING* %license COPYING*
@ -160,7 +177,9 @@ sed -i "/#!\/usr\/bin\/env/d" %{buildroot}%{_kf5_libdir}/krita-python-libs/krita
%{_kf5_appstreamdir}/ %{_kf5_appstreamdir}/
%{_kf5_libdir}/libkrita*.so.* %{_kf5_libdir}/libkrita*.so.*
%{_kf5_libdir}/kritaplugins/ %{_kf5_libdir}/kritaplugins/
%if %{with python}
%{_kf5_libdir}/krita-python-libs/ %{_kf5_libdir}/krita-python-libs/
%endif
%{_kf5_qmldir} %{_kf5_qmldir}
%{_kf5_sharedir}/kritaplugins/ %{_kf5_sharedir}/kritaplugins/
%{_kf5_sharedir}/color/ %{_kf5_sharedir}/color/