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