Added
Link Here
|
0 |
- |
1 |
--- ufraw_exiv2.cc.orig 2021-04-25 05:24:28 UTC |
|
|
2 |
+++ ufraw_exiv2.cc |
3 |
@@ -50,10 +50,10 @@ extern "C" int ufraw_exif_read_input(ufraw_data *uf) |
4 |
uf->inputExifBuf = NULL; |
5 |
uf->inputExifBufLen = 0; |
6 |
|
7 |
- Exiv2::Image::AutoPtr image; |
8 |
+ Exiv2::Image::UniquePtr image; |
9 |
if (uf->unzippedBuf != NULL) { |
10 |
- image = Exiv2::ImageFactory::open( |
11 |
- (const Exiv2::byte*)uf->unzippedBuf, uf->unzippedBufLen); |
12 |
+ image = std::move(Exiv2::ImageFactory::open( |
13 |
+ (const Exiv2::byte*)uf->unzippedBuf, uf->unzippedBufLen)); |
14 |
} else { |
15 |
char *filename = uf_win32_locale_filename_from_utf8(uf->filename); |
16 |
image = Exiv2::ImageFactory::open(filename); |
17 |
@@ -66,7 +66,9 @@ extern "C" int ufraw_exif_read_input(ufraw_data *uf) |
18 |
if (exifData.empty()) { |
19 |
std::string error(uf->filename); |
20 |
error += ": No Exif data found in the file"; |
21 |
-#if EXIV2_TEST_VERSION(0,27,0) |
22 |
+#if EXIV2_TEST_VERSION(0,28,0) |
23 |
+ throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage, error); |
24 |
+#elif EXIV2_TEST_VERSION(0,27,0) |
25 |
throw Exiv2::Error(Exiv2::kerErrorMessage, error); |
26 |
#else |
27 |
throw Exiv2::Error(1, error); |
28 |
@@ -135,7 +137,7 @@ extern "C" int ufraw_exif_read_input(ufraw_data *uf) |
29 |
ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str()); |
30 |
|
31 |
return UFRAW_SUCCESS; |
32 |
- } catch (Exiv2::AnyError& e) { |
33 |
+ } catch (Exiv2::Error& e) { |
34 |
std::cerr.rdbuf(savecerr); |
35 |
std::string s(e.what()); |
36 |
ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str()); |
37 |
@@ -155,8 +157,8 @@ static Exiv2::ExifData ufraw_prepare_exifdata(ufraw_da |
38 |
/* Reset orientation tag since UFRaw already rotates the image */ |
39 |
if ((pos = exifData.findKey(Exiv2::ExifKey("Exif.Image.Orientation"))) |
40 |
!= exifData.end()) { |
41 |
- ufraw_message(UFRAW_SET_LOG, "Resetting %s from '%d' to '1'\n", |
42 |
- pos->key().c_str(), pos->value().toLong()); |
43 |
+ ufraw_message(UFRAW_SET_LOG, "Resetting %s from '%ld' to '1'\n", |
44 |
+ pos->key().c_str(), static_cast<long int>(pos->value().toInt64())); |
45 |
pos->setValue("1"); /* 1 = Normal orientation */ |
46 |
} |
47 |
} |
48 |
@@ -327,7 +329,7 @@ extern "C" int ufraw_exif_prepare_output(ufraw_data *u |
49 |
ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str()); |
50 |
|
51 |
return UFRAW_SUCCESS; |
52 |
- } catch (Exiv2::AnyError& e) { |
53 |
+ } catch (Exiv2::Error& e) { |
54 |
std::cerr.rdbuf(savecerr); |
55 |
std::string s(e.what()); |
56 |
ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str()); |
57 |
@@ -347,7 +349,7 @@ extern "C" int ufraw_exif_write(ufraw_data *uf) |
58 |
|
59 |
char *filename = |
60 |
uf_win32_locale_filename_from_utf8(uf->conf->outputFilename); |
61 |
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename); |
62 |
+ Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(filename) }; |
63 |
uf_win32_locale_filename_free(filename); |
64 |
assert(image.get() != 0); |
65 |
|
66 |
@@ -367,7 +369,7 @@ extern "C" int ufraw_exif_write(ufraw_data *uf) |
67 |
ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str()); |
68 |
|
69 |
return UFRAW_SUCCESS; |
70 |
- } catch (Exiv2::AnyError& e) { |
71 |
+ } catch (Exiv2::Error& e) { |
72 |
std::cerr.rdbuf(savecerr); |
73 |
std::string s(e.what()); |
74 |
ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str()); |