changeset 496:a1f13fab6686

fixed a bug in opening files with non-utf8 locales in exiv2.cc
author nadvornik
date Wed, 23 Apr 2008 21:08:29 +0000
parents c7a2471e5c4e
children a33badd85f16
files src/exiv2.cc
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/exiv2.cc	Wed Apr 23 20:47:19 2008 +0000
+++ b/src/exiv2.cc	Wed Apr 23 21:08:29 2008 +0000
@@ -53,6 +53,7 @@
 #include "main.h"
 #include "exif.h"
 #include "filelist.h"
+#include "ui_fileops.h"
 
 }
 
@@ -76,7 +77,9 @@
 		have_sidecar = false;
 		cp_data = NULL;
 		cp_length = 0;
-		image = Exiv2::ImageFactory::open(path);
+		gchar *pathl = path_from_utf8(path);
+		image = Exiv2::ImageFactory::open(pathl);
+		g_free(pathl);
 //		g_assert (image.get() != 0);
 		image->readMetadata();
 
@@ -84,7 +87,9 @@
 		DEBUG_2("xmp count %li\n", image->xmpData().count());
 		if (sidecar_path && image->xmpData().empty())
 			{
-			sidecar = Exiv2::ImageFactory::open(sidecar_path);
+			gchar *sidecar_pathl = path_from_utf8(sidecar_path);
+			sidecar = Exiv2::ImageFactory::open(sidecar_pathl);
+			g_free(sidecar_pathl);
 			sidecar->readMetadata();
 			have_sidecar = sidecar->good();
 			DEBUG_2("sidecar xmp count %li\n", sidecar->xmpData().count());