Added
Link Here
|
0 |
- |
1 |
--- src/uni-exiv2.cpp.orig 2021-11-21 14:49:46 UTC |
|
|
2 |
+++ src/uni-exiv2.cpp |
3 |
@@ -27,7 +27,7 @@ |
4 |
|
5 |
#define ARRAY_SIZE(array) (sizeof array/sizeof(array[0])) |
6 |
|
7 |
-static Exiv2::Image::AutoPtr cached_image; |
8 |
+static Exiv2::Image::UniquePtr cached_image; |
9 |
|
10 |
extern "C" |
11 |
void |
12 |
@@ -35,7 +35,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(c |
13 |
{ |
14 |
Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute); |
15 |
try { |
16 |
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri); |
17 |
+ Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(uri) }; |
18 |
if ( image.get() == 0 ) { |
19 |
return; |
20 |
} |
21 |
@@ -80,7 +80,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(c |
22 |
} |
23 |
} |
24 |
} |
25 |
- } catch (Exiv2::AnyError& e) { |
26 |
+ } catch (Exiv2::Error& e) { |
27 |
std::cerr << "Exiv2: '" << e << "'\n"; |
28 |
} |
29 |
} |
30 |
@@ -97,13 +97,13 @@ uni_read_exiv2_to_cache(const char *uri) |
31 |
} |
32 |
|
33 |
try { |
34 |
- cached_image = Exiv2::ImageFactory::open(uri); |
35 |
+ cached_image = std::move(Exiv2::ImageFactory::open(uri)); |
36 |
if ( cached_image.get() == 0 ) { |
37 |
return 1; |
38 |
} |
39 |
|
40 |
cached_image->readMetadata(); |
41 |
- } catch (Exiv2::AnyError& e) { |
42 |
+ } catch (Exiv2::Error& e) { |
43 |
std::cerr << "Exiv2: '" << e << "'\n"; |
44 |
} |
45 |
|
46 |
@@ -121,7 +121,7 @@ uni_write_exiv2_from_cache(const char *uri) |
47 |
} |
48 |
|
49 |
try { |
50 |
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri); |
51 |
+ Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(uri) }; |
52 |
if ( image.get() == 0 ) { |
53 |
return 2; |
54 |
} |
55 |
@@ -133,7 +133,7 @@ uni_write_exiv2_from_cache(const char *uri) |
56 |
cached_image.reset(NULL); |
57 |
|
58 |
return 0; |
59 |
- } catch (Exiv2::AnyError& e) { |
60 |
+ } catch (Exiv2::Error& e) { |
61 |
std::cerr << "Exiv2: '" << e << "'\n"; |
62 |
} |
63 |
|