[Pkg-phototools-devel] Bug#460718: Bug#460718: qtpfsgui: Unable to retrieve exposure information when path contains UTF-8 special chars

Cyril Brulebois cyril.brulebois at enst-bretagne.fr
Wed Jan 16 00:41:36 UTC 2008


forwarded 460718 http://sourceforge.net/tracker/index.php?func=detail&aid=1870009&group_id=183831&atid=906820
thanks

Why so long URLs? Sigh… Giuseppe, you can drop control@ from your
replies, it is only there so that the above is taken into account in the
bug tracking system.


On 14/01/2008, Julien Valroff wrote:
> Hi,

Hi again, Julien. :)

> qtpfsgui cannot retrieve exposure information when the path contains UTF-8
> special chars.

> As an example, if I store my JPEG pictures in "/home/julien/Images
> numériques", qtpfsgui cannot use the EXIF data of the pictures.
> 
> If I rename the folder to "/home/julien/Images numeriques" (ie.
> without the accent), it works OK.

Similar bugreports exist on sourceforge's tracker:
 - http://sourceforge.net/tracker/index.php?func=detail&aid=1870009&group_id=183831&atid=906820
 - http://sourceforge.net/tracker/index.php?func=detail&aid=1870019&group_id=183831&atid=906820 (duplicate)

Here is a possible workaround (as in “works for me”), but that might not
be how Giuseppe wants to do things. Furthermore, they are many
occurrences to adapt, so I'm not comfortable with doing so myself and
shipping such a modified version (I don't want to introduce crashes when
trying to limit them).

Patch attached.

Cheers,

-- 
Cyril Brulebois
-------------- next part --------------
diff -ur qtpfsgui-1.9.0/src/Exif/exif_operations.cpp qtpfsgui.kibi/src/Exif/exif_operations.cpp
--- qtpfsgui-1.9.0/src/Exif/exif_operations.cpp	2007-08-26 16:52:24.000000000 +0000
+++ qtpfsgui.kibi/src/Exif/exif_operations.cpp	2008-01-16 00:34:25.000000000 +0000
@@ -23,6 +23,7 @@
 
 #include <image.hpp>
 #include <cmath>
+#include <QFileInfo>
 #include "exif_operations.h"
 
 void ExifOperations::writeExifData(const std::string& filename, const std::string& comment) {
@@ -79,9 +80,9 @@
 	destimage->writeMetadata();
 }
 
-float ExifOperations::obtain_expotime(const std::string& filename) {
+float ExifOperations::obtain_expotime(const QString& filename) {
 try {
-	Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename);
+	Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*) (QFile::encodeName(filename)));
 	image->readMetadata();
 	Exiv2::ExifData &exifData = image->exifData();
 	if (exifData.empty())
Seulement dans qtpfsgui.kibi/src/Exif: exif_operations.cpp.orig
diff -ur qtpfsgui-1.9.0/src/Exif/exif_operations.h qtpfsgui.kibi/src/Exif/exif_operations.h
--- qtpfsgui-1.9.0/src/Exif/exif_operations.h	2007-08-26 16:52:24.000000000 +0000
+++ qtpfsgui.kibi/src/Exif/exif_operations.h	2008-01-16 00:34:25.000000000 +0000
@@ -30,7 +30,7 @@
 public:
 	static void writeExifData(const std::string& filename, const std::string& comment);
 	static void copyExifData(const std::string& from, const std::string& to, bool dont_overwrite);
-	static float obtain_expotime(const std::string& filename);
+	static float obtain_expotime(const QString& filename);
 private:
 
 };
diff -ur qtpfsgui-1.9.0/src/Threads/hdrInputLoader.cpp qtpfsgui.kibi/src/Threads/hdrInputLoader.cpp
--- qtpfsgui-1.9.0/src/Threads/hdrInputLoader.cpp	2007-11-25 16:45:57.000000000 +0000
+++ qtpfsgui.kibi/src/Threads/hdrInputLoader.cpp	2008-01-16 00:34:25.000000000 +0000
@@ -40,7 +40,7 @@
 		QFileInfo qfi(fname);
 
 		//get exposure time, -1 is error
-		float expotime=ExifOperations::obtain_expotime(qfi.filePath().toStdString());
+		float expotime=ExifOperations::obtain_expotime(qfi.filePath());
 
 		QString extension=qfi.suffix().toUpper(); //get filename extension
 		//now go and fill the list of image data (real payload)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-phototools-devel/attachments/20080116/644237b6/attachment-0001.pgp 


More information about the Pkg-phototools-devel mailing list