1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
--- src/imageutils/jpegcontent.cpp.orig 2009-01-09 22:54:12.000000000 +0500
+++ src/imageutils/jpegcontent.cpp 2009-01-09 22:56:48.000000000 +0500
@@ -47,6 +47,17 @@
#include "imageutils/jpegcontent.h"
#include "imageutils/jpegerrormanager.h"
+// Make sure an EXIV2_TEST_VERSION macro exists:
+
+#ifdef EXIV2_VERSION
+# ifndef EXIV2_TEST_VERSION
+# define EXIV2_TEST_VERSION(major,minor,patch) \
+ ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) )
+# endif
+#else
+# define EXIV2_TEST_VERSION(major,minor,patch) (false)
+#endif
+
namespace ImageUtils {
const int INMEM_DST_DELTA=4096;
@@ -589,7 +600,12 @@
QImage JPEGContent::thumbnail() const {
QImage image;
if (!d->mExifData.empty()) {
+#if (EXIV2_TEST_VERSION(0,17,91))
+ Exiv2::ExifThumbC thumb(d->mExifData);
+ Exiv2::DataBuf const thumbnail = thumb.copy();
+#else
Exiv2::DataBuf thumbnail = d->mExifData.copyThumbnail();
+#endif
image.loadFromData(thumbnail.pData_, thumbnail.size_);
}
return image;
@@ -611,7 +627,12 @@
return;
}
+#if (EXIV2_TEST_VERSION(0,17,91))
+ Exiv2::ExifThumb thumb(d->mExifData);
+ thumb.setJpegThumbnail((unsigned char*)array.data(), array.size());
+#else
d->mExifData.setJpegThumbnail((unsigned char*)array.data(), array.size());
+#endif
}
|