Added
Link Here
|
1 |
--- core/libs/metadataengine/engine/metaengine_exif.cpp.orig 2023-03-12 13:19:02 UTC |
2 |
+++ core/libs/metadataengine/engine/metaengine_exif.cpp |
3 |
@@ -80,7 +80,7 @@ bool MetaEngine::canWriteExif(const QString& filePath) |
4 |
catch (Exiv2::AnyError& e) |
5 |
{ |
6 |
qCCritical(DIGIKAM_METAENGINE_LOG) << "Cannot check Exif access mode with Exiv2:(Error #" |
7 |
- << e.code() << ": " << QString::fromStdString(e.what()) << ")"; |
8 |
+ << static_cast<int>(e.code()) << ": " << QString::fromStdString(e.what()) << ")"; |
9 |
} |
10 |
catch (...) |
11 |
{ |
12 |
@@ -739,7 +739,7 @@ bool MetaEngine::getExifTagLong(const char* exifTagNam |
13 |
|
14 |
if ((it != exifData.end()) && (it->count() > 0)) |
15 |
{ |
16 |
- val = it->toLong(component); |
17 |
+ val = it->toInt64(component); |
18 |
|
19 |
return true; |
20 |
} |
21 |
@@ -812,7 +812,7 @@ QVariant MetaEngine::getExifTagVariant(const char* exi |
22 |
{ |
23 |
if ((int)it->count() > component) |
24 |
{ |
25 |
- return QVariant((int)it->toLong(component)); |
26 |
+ return QVariant((int)it->toInt64(component)); |
27 |
} |
28 |
else |
29 |
{ |
30 |
@@ -915,7 +915,7 @@ QString MetaEngine::getExifTagString(const char* exifT |
31 |
QString tagValue; |
32 |
QString key = QLatin1String(it->key().c_str()); |
33 |
|
34 |
- if ((key == QLatin1String("Exif.CanonCs.LensType")) && (it->toLong() == 65535)) |
35 |
+ if ((key == QLatin1String("Exif.CanonCs.LensType")) && (it->toInt64() == 65535)) |
36 |
{ |
37 |
// FIXME: workaround for a possible crash in Exiv2 pretty-print function for the Exif.CanonCs.LensType. |
38 |
|
39 |
@@ -987,12 +987,12 @@ QImage MetaEngine::getExifThumbnail(bool fixOrientatio |
40 |
Exiv2::ExifThumbC thumb(d->exifMetadata()); |
41 |
Exiv2::DataBuf const c1 = thumb.copy(); |
42 |
|
43 |
- if (c1.size_ == 0) |
44 |
+ if (c1.size() == 0) |
45 |
{ |
46 |
return thumbnail; |
47 |
} |
48 |
|
49 |
- thumbnail.loadFromData(c1.pData_, c1.size_); |
50 |
+ thumbnail.loadFromData(c1.c_data(), c1.size()); |
51 |
|
52 |
if (!thumbnail.isNull()) |
53 |
{ |
54 |
@@ -1010,7 +1010,7 @@ QImage MetaEngine::getExifThumbnail(bool fixOrientatio |
55 |
|
56 |
if (it != exifData.end() && it->count()) |
57 |
{ |
58 |
- long orientation = it->toLong(); |
59 |
+ long orientation = it->toInt64(); |
60 |
|
61 |
//qCDebug(DIGIKAM_METAENGINE_LOG) << "Exif Thumbnail Orientation: " << (int)orientation; |
62 |
|
63 |
@@ -1092,12 +1092,12 @@ bool MetaEngine::setTiffThumbnail(const QImage& thumbI |
64 |
|
65 |
Exiv2::ExifData::const_iterator pos = d->exifMetadata().findKey(Exiv2::ExifKey("Exif.Image.NewSubfileType")); |
66 |
|
67 |
- if ((pos == d->exifMetadata().end()) || (pos->count() != 1) || (pos->toLong() != 0)) |
68 |
+ if ((pos == d->exifMetadata().end()) || (pos->count() != 1) || (pos->toInt64() != 0)) |
69 |
{ |
70 |
|
71 |
#if EXIV2_TEST_VERSION(0,27,0) |
72 |
|
73 |
- throw Exiv2::Error(Exiv2::kerErrorMessage, "Exif.Image.NewSubfileType missing or not set as main image"); |
74 |
+ throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage, "Exif.Image.NewSubfileType missing or not set as main image"); |
75 |
|
76 |
#else |
77 |
|
78 |
@@ -1136,9 +1136,9 @@ bool MetaEngine::setTiffThumbnail(const QImage& thumbI |
79 |
Exiv2::DataBuf buf((Exiv2::byte*)data.data(), data.size()); |
80 |
Exiv2::ULongValue val; |
81 |
val.read("0"); |
82 |
- val.setDataArea(buf.pData_, buf.size_); |
83 |
+ val.setDataArea(buf.c_data(), buf.size()); |
84 |
d->exifMetadata()["Exif.SubImage1.JPEGInterchangeFormat"] = val; |
85 |
- d->exifMetadata()["Exif.SubImage1.JPEGInterchangeFormatLength"] = uint32_t(buf.size_); |
86 |
+ d->exifMetadata()["Exif.SubImage1.JPEGInterchangeFormatLength"] = uint32_t(buf.size()); |
87 |
d->exifMetadata()["Exif.SubImage1.Compression"] = uint16_t(6); // JPEG (old-style) |
88 |
d->exifMetadata()["Exif.SubImage1.NewSubfileType"] = uint32_t(1); // Thumbnail image |
89 |
|
90 |
@@ -1261,7 +1261,7 @@ MetaEngine::MetaDataMap MetaEngine::getExifTagsDataLis |
91 |
{ |
92 |
tagValue = QString::number(md->value().size()); |
93 |
} |
94 |
- else if (key == QLatin1String("Exif.CanonCs.LensType") && md->toLong() == 65535) |
95 |
+ else if (key == QLatin1String("Exif.CanonCs.LensType") && md->toInt64() == 65535) |
96 |
{ |
97 |
// FIXME: workaround for a possible crash in Exiv2 pretty-print function for the Exif.CanonCs.LensType. |
98 |
|