Added
Link Here
|
1 |
--- src/Exif/ExifOperations.cpp.orig 2021-01-11 09:41:28 UTC |
2 |
+++ src/Exif/ExifOperations.cpp |
3 |
@@ -108,12 +108,12 @@ void copyExifData(const std::string &from, const std:: |
4 |
#endif |
5 |
|
6 |
try { |
7 |
- Exiv2::Image::AutoPtr sourceImage; |
8 |
+ Exiv2::Image::UniquePtr sourceImage; |
9 |
Exiv2::ExifData srcExifData; |
10 |
|
11 |
if (!from.empty()) { |
12 |
// get source exif data |
13 |
- sourceImage = Exiv2::ImageFactory::open(from); |
14 |
+ sourceImage = std::move(Exiv2::ImageFactory::open(from)); |
15 |
|
16 |
sourceImage->readMetadata(); |
17 |
srcExifData = sourceImage->exifData(); |
18 |
@@ -128,7 +128,7 @@ void copyExifData(const std::string &from, const std:: |
19 |
} |
20 |
|
21 |
// get destination exif data |
22 |
- Exiv2::Image::AutoPtr destinationImage = Exiv2::ImageFactory::open(to); |
23 |
+ Exiv2::Image::UniquePtr destinationImage = Exiv2::ImageFactory::open(to); |
24 |
|
25 |
if (dontOverwrite) { |
26 |
// doesn't throw anything if it is empty |
27 |
@@ -212,7 +212,7 @@ void copyExifData(const std::string &from, const std:: |
28 |
destinationImage->setExifData(srcExifData); |
29 |
} |
30 |
destinationImage->writeMetadata(); |
31 |
- } catch (Exiv2::AnyError &e) { |
32 |
+ } catch (Exiv2::Error &e) { |
33 |
#ifndef NDEBUG |
34 |
qDebug() << e.what(); |
35 |
#endif |
36 |
@@ -250,7 +250,7 @@ float obtain_avg_lum(const std::string& filename) |
37 |
{ |
38 |
try |
39 |
{ |
40 |
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename); |
41 |
+ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(filename); |
42 |
image->readMetadata(); |
43 |
Exiv2::ExifData &exifData = image->exifData(); |
44 |
if (exifData.empty()) |
45 |
@@ -329,7 +329,7 @@ allowed for ev computation purposes. |
46 |
return -1; |
47 |
} |
48 |
} |
49 |
- catch (Exiv2::AnyError& e) |
50 |
+ catch (Exiv2::Error& e) |
51 |
{ |
52 |
return -1; |
53 |
} |
54 |
@@ -338,7 +338,7 @@ allowed for ev computation purposes. |
55 |
|
56 |
float getExposureTime(const std::string &filename) { |
57 |
try { |
58 |
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename); |
59 |
+ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(filename); |
60 |
image->readMetadata(); |
61 |
Exiv2::ExifData &exifData = image->exifData(); |
62 |
if (exifData.empty()) return -1; |
63 |
@@ -374,14 +374,14 @@ float getExposureTime(const std::string &filename) { |
64 |
} else { |
65 |
return -1; |
66 |
} |
67 |
- } catch (Exiv2::AnyError &e) { |
68 |
+ } catch (Exiv2::Error &e) { |
69 |
return -1; |
70 |
} |
71 |
} |
72 |
|
73 |
float getAverageLuminance(const std::string &filename) { |
74 |
try { |
75 |
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename); |
76 |
+ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(filename); |
77 |
image->readMetadata(); |
78 |
Exiv2::ExifData &exifData = image->exifData(); |
79 |
|
80 |
@@ -403,7 +403,7 @@ float getAverageLuminance(const std::string &filename) |
81 |
<< std::endl; |
82 |
|
83 |
return -1.0; |
84 |
- } catch (Exiv2::AnyError &e) { |
85 |
+ } catch (Exiv2::Error &e) { |
86 |
return -1.0; |
87 |
} |
88 |
} |