changeset 2891:f02e6b7c1336

Merge merge requests 660, 658, 655 and 648 * github/merge-requests/660: tr.po-update * github/merge-requests/658: Bug fix: reads of uninitialized data * github/merge-requests/655: fix build against exiv2-0.27.x * github/merge-requests/648: Correctly size image windows opened from collections
author Klaus Ethgen <Klaus@Ethgen.de>
date Tue, 05 Feb 2019 21:06:16 +0100
parents d89d46433c78 (diff) 627bd720b0a1 (current diff)
children 10177e8c588b
files src/exiv2.cc
diffstat 3 files changed, 26 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/exif-common.c	Tue Feb 05 21:06:16 2019 +0100
+++ b/src/exif-common.c	Tue Feb 05 21:06:16 2019 +0100
@@ -885,7 +885,7 @@
 
 static gchar *exif_build_formatted_star_rating(ExifData *exif)
 {
-	gint n;
+	gint n = 0;
 
 	exif_get_integer(exif, "Xmp.xmp.Rating", &n);
 
--- a/src/exiv2.cc	Tue Feb 05 21:06:16 2019 +0100
+++ b/src/exiv2.cc	Tue Feb 05 21:06:16 2019 +0100
@@ -22,25 +22,17 @@
 
 #ifdef HAVE_EXIV2
 
-// Don't include the <exiv2/version.hpp> file directly
-// Early Exiv2 versions didn't have version.hpp and the macros.
-#include <exiv2/exiv2.hpp>
+#include <exiv2/image.hpp>
+#include <exiv2/exif.hpp>
 #include <iostream>
 #include <string>
 
 // EXIV2_TEST_VERSION is defined in Exiv2 0.15 and newer.
-#ifdef EXIV2_VERSION
 #ifndef EXIV2_TEST_VERSION
-#define EXIV2_TEST_VERSION(major,minor,patch) \
+# define EXIV2_TEST_VERSION(major,minor,patch) \
 	( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) )
 #endif
-#else
-#define EXIV2_TEST_VERSION(major,minor,patch) (false)
-#endif
 
-#if EXIV2_TEST_VERSION(0,27,0)
-#define HAVE_EXIV2_ERROR_CODE
-#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -48,8 +40,27 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if EXIV2_TEST_VERSION(0,27,0)
-#define EXV_PACKAGE "exiv2"
+#if !EXIV2_TEST_VERSION(0,17,90)
+#include <exiv2/tiffparser.hpp>
+#include <exiv2/tiffcomposite.hpp>
+#include <exiv2/tiffvisitor.hpp>
+#include <exiv2/tiffimage.hpp>
+#include <exiv2/cr2image.hpp>
+#include <exiv2/crwimage.hpp>
+#if EXIV2_TEST_VERSION(0,16,0)
+#include <exiv2/orfimage.hpp>
+#endif
+#if EXIV2_TEST_VERSION(0,13,0)
+#include <exiv2/rafimage.hpp>
+#endif
+#include <exiv2/futils.hpp>
+#else
+#include <exiv2/preview.hpp>
+#endif
+
+#if EXIV2_TEST_VERSION(0,17,0)
+#include <exiv2/convert.hpp>
+#include <exiv2/xmpsidecar.hpp>
 #endif
 
 extern "C" {
@@ -363,11 +374,7 @@
 #endif
 			Exiv2::Image *image = imageData_->image();
 
-#ifdef HAVE_EXIV2_ERROR_CODE
-			if (!image) throw Exiv2::Error(Exiv2::ErrorCode::kerInputDataReadFailed);
-#else
 			if (!image) throw Exiv2::Error(21);
-#endif
 			image->setExifData(exifData_);
 			image->setIptcData(iptcData_);
 #if EXIV2_TEST_VERSION(0,16,0)
@@ -387,12 +394,8 @@
 			sidecar->setXmpData(xmpData_);
 			sidecar->writeMetadata();
 #else
-#ifdef HAVE_EXIV2_ERROR_CODE
-			throw Exiv2::Error(Exiv2::ErrorCode::kerNotAnImage, "xmp");
-#else
 			throw Exiv2::Error(3, "xmp");
 #endif
-#endif
 			}
 	}
 
--- a/src/view_dir_list.c	Tue Feb 05 21:06:16 2019 +0100
+++ b/src/view_dir_list.c	Tue Feb 05 21:06:16 2019 +0100
@@ -149,7 +149,7 @@
 	FileData *fd;
 	SortType sort_type = SORT_NAME;
 	gboolean sort_ascend = TRUE;
-	gchar *link;
+	gchar *link = NULL;
 
 	old_list = VDLIST(vd)->list;