rev |
line source |
al@19883
|
1 From 0b044d1d685307e5755917e31d56a1a3104cd505 Mon Sep 17 00:00:00 2001
|
al@19883
|
2 From: David Kalnischkies <david@kalnischkies.de>
|
al@19883
|
3 Date: Fri, 27 May 2016 12:04:40 +0100
|
al@19883
|
4 Subject: [PATCH] Work around changed c++11 std::string implementation
|
al@19883
|
5
|
al@19883
|
6 Bug was already partly fixed by 96db62d but there was even more
|
al@19883
|
7 positions that was unseen by Solomon.
|
al@19883
|
8
|
al@19883
|
9 The patch is originally from Debian bug report #800350.
|
al@19883
|
10
|
al@19883
|
11 Signed-off-by: Klaus Ethgen <Klaus@Ethgen.de>
|
al@19883
|
12 ---
|
al@19883
|
13 src/exiv2.cc | 12 +++++++-----
|
al@19883
|
14 1 file changed, 7 insertions(+), 5 deletions(-)
|
al@19883
|
15
|
al@19883
|
16 diff --git a/src/exiv2.cc b/src/exiv2.cc
|
al@19883
|
17 index 1dbe1182..49b8e07c 100644
|
al@19883
|
18 --- a/src/exiv2.cc
|
al@19883
|
19 +++ b/src/exiv2.cc
|
al@19883
|
20 @@ -25,6 +25,7 @@
|
al@19883
|
21 #include <exiv2/image.hpp>
|
al@19883
|
22 #include <exiv2/exif.hpp>
|
al@19883
|
23 #include <iostream>
|
al@19883
|
24 +#include <string>
|
al@19883
|
25
|
al@19883
|
26 // EXIV2_TEST_VERSION is defined in Exiv2 0.15 and newer.
|
al@19883
|
27 #ifndef EXIV2_TEST_VERSION
|
al@19883
|
28 @@ -1140,8 +1141,9 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width,
|
al@19883
|
29
|
al@19883
|
30 if (!exif->image()) return NULL;
|
al@19883
|
31
|
al@19883
|
32 + std::string const path = exif->image()->io().path();
|
al@19883
|
33 /* given image pathname, first do simple (and fast) file extension test */
|
al@19883
|
34 - gboolean is_raw = filter_file_class(exif->image()->io().path().c_str(), FORMAT_CLASS_RAWIMAGE);
|
al@19883
|
35 + gboolean is_raw = filter_file_class(path.c_str(), FORMAT_CLASS_RAWIMAGE);
|
al@19883
|
36
|
al@19883
|
37 if (!is_raw && requested_width == 0) return NULL;
|
al@19883
|
38
|
al@19883
|
39 @@ -1241,10 +1243,10 @@ extern "C" guchar *exif_get_preview(ExifData *exif, guint *data_len, gint reques
|
al@19883
|
40 if (!exif) return NULL;
|
al@19883
|
41 if (!exif->image()) return NULL;
|
al@19883
|
42
|
al@19883
|
43 - const char* path = exif->image()->io().path().c_str();
|
al@19883
|
44 + std::string const path = exif->image()->io().path();
|
al@19883
|
45
|
al@19883
|
46 /* given image pathname, first do simple (and fast) file extension test */
|
al@19883
|
47 - if (!filter_file_class(path, FORMAT_CLASS_RAWIMAGE)) return NULL;
|
al@19883
|
48 + if (!filter_file_class(path.c_str(), FORMAT_CLASS_RAWIMAGE)) return NULL;
|
al@19883
|
49
|
al@19883
|
50 try {
|
al@19883
|
51 struct stat st;
|
al@19883
|
52 @@ -1255,9 +1257,9 @@ extern "C" guchar *exif_get_preview(ExifData *exif, guint *data_len, gint reques
|
al@19883
|
53
|
al@19883
|
54 RawFile rf(exif->image()->io());
|
al@19883
|
55 offset = rf.preview_offset();
|
al@19883
|
56 - DEBUG_1("%s: offset %lu", path, offset);
|
al@19883
|
57 + DEBUG_1("%s: offset %lu", path.c_str(), offset);
|
al@19883
|
58
|
al@19883
|
59 - fd = open(path, O_RDONLY);
|
al@19883
|
60 + fd = open(path.c_str(), O_RDONLY);
|
al@19883
|
61 if (fd == -1)
|
al@19883
|
62 {
|
al@19883
|
63 return NULL;
|
al@19883
|
64 --
|
al@19883
|
65 2.13.2
|
al@19883
|
66
|