1 Subject: Fix RAW photos display with new GCC
2 From: David Kalnischkies <david@kalnischkies.de>
4 diff --git a/src/exiv2.cc b/src/exiv2.cc
5 index 455c8d3..98029cd 100644
9 #include <exiv2/image.hpp>
10 #include <exiv2/exif.hpp>
14 // EXIV2_TEST_VERSION is defined in Exiv2 0.15 and newer.
15 #ifndef EXIV2_TEST_VERSION
16 @@ -1130,9 +1131,9 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width,
18 if (!exif->image()) return NULL;
20 - const char* path = exif->image()->io().path().c_str();
21 + std::string const path = exif->image()->io().path();
22 /* given image pathname, first do simple (and fast) file extension test */
23 - gboolean is_raw = filter_file_class(path, FORMAT_CLASS_RAWIMAGE);
24 + gboolean is_raw = filter_file_class(path.c_str(), FORMAT_CLASS_RAWIMAGE);
26 if (!is_raw && requested_width == 0) return NULL;
28 @@ -1232,10 +1233,10 @@ extern "C" guchar *exif_get_preview(ExifData *exif, guint *data_len, gint reques
29 if (!exif) return NULL;
30 if (!exif->image()) return NULL;
32 - const char* path = exif->image()->io().path().c_str();
33 + std::string const path = exif->image()->io().path();
35 /* given image pathname, first do simple (and fast) file extension test */
36 - if (!filter_file_class(path, FORMAT_CLASS_RAWIMAGE)) return NULL;
37 + if (!filter_file_class(path.c_str(), FORMAT_CLASS_RAWIMAGE)) return NULL;
41 @@ -1246,9 +1247,9 @@ extern "C" guchar *exif_get_preview(ExifData *exif, guint *data_len, gint reques
43 RawFile rf(exif->image()->io());
44 offset = rf.preview_offset();
45 - DEBUG_1("%s: offset %lu", path, offset);
46 + DEBUG_1("%s: offset %lu", path.c_str(), offset);
48 - fd = open(path, O_RDONLY);
49 + fd = open(path.c_str(), O_RDONLY);