Project

General

Profile

Error opening file where the directory has accents

Added by Adonai Canez over 6 years ago

When I wrote my program in 2011 exiv2 opened files with directories that had accents, but this new version not open these files.
What could be wrong?

std::string directory;
image = Exiv2::ImageFactory::open(directory.c_str());

directory ---> C:\directory_ã\imagem.jpeg


Replies (6)

RE: Error opening file where the directory has accents - Added by Robin Mills over 6 years ago

Adonai

Thank you for reporting this. I am surprised by this because I don't believe there have been changes to the basicio file handling code for a few years.

It will help greatly to find out when this change may have occurred. I've built 0.23 and 0.24 from the tar-bundle on exiv2, and built the trunk. I've built an MSVC 32bit static build which should run OK on XP and higher. http://clanmills.com/files/exiv2-32bit.zip

Can you download and execute each the following commands. Please post the output here.

cd ... trunk
............trunk/> exiv2 -vV
............trunk/> exiv2 -pa c:\<your directory with accent>\foo.jpeg
Please do this test for the three builds.

RE: Error opening file where the directory has accents - Added by Robin Mills over 6 years ago

The file seems to have disappeared from clanmills.com so I've restored it. And I attach a copy to this report.

RE: Error opening file where the directory has accents - Added by Thomas Beutlich over 6 years ago

I tried to reproduce the problem on WinXP with the three provided binaries and the same directory name as stated above, but failed. It all worked as expected. Robin, did you build your binaries with EXV_UNICODE_PATH defined? It would be nice to have this information in the -vV output.

RE: Error opening file where the directory has accents - Added by Robin Mills over 6 years ago

Thomas

I'm having difficulty understanding the meaning of your message. Are you saying that you have reproduced the reported issue with the binaries I provided last week?

You are right. I should output EXV_UNICODE_PATH in the exiv2 -vV output. Those 32-bit builds were build with msvc2003 using Visual Studio 2003. I can't remember if the default for UNICODE_PATH. Can you open a new issue "Bug" with the title "Error opening file where the directory has accents". Assign the issue to me. I'll change src/version.cpp to report UNICODE_PATH and do a built with it set and ask you to test again.

Or ... you are welcome to open the "Bug" and do the work yourself. I'm very happy to accept your assistance.

Robin

RE: Error opening file where the directory has accents - Added by Adonai Canez over 6 years ago

Hello Robin,
Sorry for the delay in response.
 
I performed the tests and all worked correctly. Only the file name is displayed incorrect

I think my problem is that I needed to compile the exiv2 with mingw32 (http://sourceforge.net/projects/mingw/) version 4.8.1 and Qt 5.1 I compiled with mingw-w64 (http ://sourceforge.net/projects/mingw-w64) version 4.9.2 both 32-bit version.

I would like to be able to compile exiv2 with the 4.9.2 version of mingw-w64, but gives errors.
Have you tested with mingw-w64?

D:\>exiv2-trunk.exe d:\ã\foto.jpg
File name : d:\π\foto.jpg
File size : 210704 Bytes
MIME type : image/jpeg
Image size : 1024 x 768
Camera make : NIKON
Camera model : COOLPIX L100
Image timestamp : 2014:08:01 15:35:23
Image number :
Exposure time : 1/386 s
Aperture : F7
Exposure bias : 0 EV
Flash : No, compulsory
Flash bias :
Focal length : 5.0 mm (35 mm equivalent: 28.0 mm)
Subject distance:
ISO speed : 80
Exposure mode : Auto
Metering mode : Multi-segment
Macro mode :
Image quality : NORMAL
Exif Resolution : 1024 x 768
White balance : AUTO
Thumbnail : image/jpeg, 4360 Bytes
Copyright :
Exif comment :

RE: Error opening file where the directory has accents - Added by Robin Mills over 6 years ago

Out buildserver builds MinGW 32 and 64 bits all the time. It's currently using 4.8.3.

Nehal reported trouble with 4.9 and Thomas looked at it (and your issue) in the last couple of days. http://dev.exiv2.org/boards/3/topics/1869?r=1944#message-1944

Being a native english speaker, I have trouble with UNICODE/accents and everything outside the ascii 32-127 range! When you say Only the file name is displayed incorrect, I'm not sure what you mean. I'm willing to open an issue about this and ask Thomas to investigate. He's a German and if more familiar with this kind of thing.

MinGW is my least favourite build environment because I don't used . There are build notes here: http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform and additional information about MinGW here: http://clanmills.com/exiv2/mingw.shtml

If you are using Qt, I think you have to use MinGW. Unless you have another compelling reason to use MinGW, I encourage you to use Cygwin or MSVC. If you're really stuck with getting the build, I can zip one of a build from the buildserver for you to use.

    (1-6/6)