ports/graphics/ufraw/patches/patch-ufraw_exiv2_cc

81 lines
3.1 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Fix build with exiv2 >=0.28.0.
Index: ufraw_exiv2.cc
--- ufraw_exiv2.cc.orig
+++ ufraw_exiv2.cc
@@ -15,9 +15,8 @@
#include "ufraw.h"
#ifdef HAVE_EXIV2
-#include <exiv2/image.hpp>
-#include <exiv2/easyaccess.hpp>
-#include <exiv2/exif.hpp>
+#include <iostream>
+#include <exiv2/exiv2.hpp>
#include <sstream>
#include <cassert>
@@ -51,7 +50,7 @@ extern "C" int ufraw_exif_read_input(ufraw_data *uf)
uf->inputExifBuf = NULL;
uf->inputExifBufLen = 0;
- Exiv2::Image::AutoPtr image;
+ Exiv2::Image::UniquePtr image;
if (uf->unzippedBuf != NULL) {
image = Exiv2::ImageFactory::open(
(const Exiv2::byte*)uf->unzippedBuf, uf->unzippedBufLen);
@@ -67,7 +66,7 @@ extern "C" int ufraw_exif_read_input(ufraw_data *uf)
if (exifData.empty()) {
std::string error(uf->filename);
error += ": No Exif data found in the file";
- throw Exiv2::Error(1, error);
+ throw Exiv2::Error(Exiv2::ErrorCode::kerErrorMessage, error);
}
/* List of tag names taken from exiv2's printSummary() in actions.cpp */
@@ -132,7 +131,7 @@ extern "C" int ufraw_exif_read_input(ufraw_data *uf)
ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str());
return UFRAW_SUCCESS;
- } catch (Exiv2::AnyError& e) {
+ } catch (Exiv2::Error& e) {
std::cerr.rdbuf(savecerr);
std::string s(e.what());
ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str());
@@ -153,7 +152,7 @@ static Exiv2::ExifData ufraw_prepare_exifdata(ufraw_da
if ((pos = exifData.findKey(Exiv2::ExifKey("Exif.Image.Orientation")))
!= exifData.end()) {
ufraw_message(UFRAW_SET_LOG, "Resetting %s from '%d' to '1'\n",
- pos->key().c_str(), pos->value().toLong());
+ pos->key().c_str(), pos->value().toInt64());
pos->setValue("1"); /* 1 = Normal orientation */
}
}
@@ -324,7 +323,7 @@ extern "C" int ufraw_exif_prepare_output(ufraw_data *u
ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str());
return UFRAW_SUCCESS;
- } catch (Exiv2::AnyError& e) {
+ } catch (Exiv2::Error& e) {
std::cerr.rdbuf(savecerr);
std::string s(e.what());
ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str());
@@ -344,7 +343,7 @@ extern "C" int ufraw_exif_write(ufraw_data *uf)
char *filename =
uf_win32_locale_filename_from_utf8(uf->conf->outputFilename);
- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename);
+ Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(filename);
uf_win32_locale_filename_free(filename);
assert(image.get() != 0);
@@ -364,7 +363,7 @@ extern "C" int ufraw_exif_write(ufraw_data *uf)
ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str());
return UFRAW_SUCCESS;
- } catch (Exiv2::AnyError& e) {
+ } catch (Exiv2::Error& e) {
std::cerr.rdbuf(savecerr);
std::string s(e.what());
ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str());