Added
Link Here
|
0 |
- |
1 |
--- src/exiv2.cc.orig 2022-08-12 09:36:37 UTC |
|
|
2 |
+++ src/exiv2.cc |
3 |
@@ -52,6 +52,11 @@ |
4 |
#define EXV_PACKAGE "exiv2" |
5 |
#endif |
6 |
|
7 |
+#if EXIV2_TEST_VERSION(0,28,0) |
8 |
+#define AnyError Error |
9 |
+#define AutoPtr UniquePtr |
10 |
+#endif |
11 |
+ |
12 |
extern "C" { |
13 |
#include <glib.h> |
14 |
|
15 |
@@ -176,7 +181,7 @@ struct _ExifDataOriginal : public _ExifData (public) |
16 |
{ |
17 |
cp_data_ = NULL; |
18 |
cp_length_ = 0; |
19 |
- image_ = image; |
20 |
+ image_ = std::move(image); |
21 |
valid_ = TRUE; |
22 |
} |
23 |
|
24 |
@@ -364,7 +369,7 @@ struct _ExifDataProcessed : public _ExifData (public) |
25 |
Exiv2::Image *image = imageData_->image(); |
26 |
|
27 |
#ifdef HAVE_EXIV2_ERROR_CODE |
28 |
- if (!image) throw Exiv2::Error(Exiv2::kerInputDataReadFailed); |
29 |
+ if (!image) throw Exiv2::Error(Exiv2::ErrorCode::kerInputDataReadFailed); |
30 |
#else |
31 |
if (!image) throw Exiv2::Error(21); |
32 |
#endif |
33 |
@@ -388,7 +393,7 @@ struct _ExifDataProcessed : public _ExifData (public) |
34 |
sidecar->writeMetadata(); |
35 |
#else |
36 |
#ifdef HAVE_EXIV2_ERROR_CODE |
37 |
- throw Exiv2::Error(Exiv2::kerNotAnImage, "xmp"); |
38 |
+ throw Exiv2::Error(Exiv2::ErrorCode::kerNotAnImage, "xmp"); |
39 |
#else |
40 |
throw Exiv2::Error(3, "xmp"); |
41 |
#endif |
42 |
@@ -840,7 +845,7 @@ gint exif_item_get_integer(ExifItem *item, gint *value |
43 |
{ |
44 |
try { |
45 |
if (!item || exif_item_get_elements(item) == 0) return 0; |
46 |
- *value = ((Exiv2::Metadatum *)item)->toLong(); |
47 |
+ *value = ((Exiv2::Metadatum *)item)->toInt64(); |
48 |
return 1; |
49 |
} |
50 |
catch (Exiv2::AnyError& e) { |
51 |
@@ -1224,11 +1229,12 @@ guchar *exif_get_preview(ExifData *exif, guint *data_l |
52 |
|
53 |
Exiv2::PreviewImage image = pm.getPreviewImage(*pos); |
54 |
|
55 |
+ // https://github.com/BestImageViewer/geeqie/issues/1090 |
56 |
Exiv2::DataBuf buf = image.copy(); |
57 |
- std::pair<Exiv2::byte*, long> p = buf.release(); |
58 |
- |
59 |
- *data_len = p.second; |
60 |
- return p.first; |
61 |
+ *data_len = buf.size(); |
62 |
+ auto b = buf.data(); |
63 |
+ buf.reset(); |
64 |
+ return b; |
65 |
} |
66 |
return NULL; |
67 |
} |
68 |
@@ -1489,22 +1495,22 @@ unsigned long RawFile::preview_offset(void) |
69 |
if (type == Exiv2::ImageType::cr2) |
70 |
{ |
71 |
val = find(0x111, Group::ifd0); |
72 |
- if (val) return val->toLong(); |
73 |
+ if (val) return val->toInt64(); |
74 |
|
75 |
return 0; |
76 |
} |
77 |
|
78 |
val = find(0x201, Group::sub0_0); |
79 |
- if (val) return val->toLong(); |
80 |
+ if (val) return val->toInt64(); |
81 |
|
82 |
val = find(0x201, Group::ifd0); |
83 |
- if (val) return val->toLong(); |
84 |
+ if (val) return val->toInt64(); |
85 |
|
86 |
val = find(0x201, Group::ignr); // for PEF files, originally it was probably ifd2 |
87 |
- if (val) return val->toLong(); |
88 |
+ if (val) return val->toInt64(); |
89 |
|
90 |
val = find(0x111, Group::sub0_1); // dng |
91 |
- if (val) return val->toLong(); |
92 |
+ if (val) return val->toInt64(); |
93 |
|
94 |
return 0; |
95 |
} |