brunolojor / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

Cannot import photo's with accented characters in path or file name (windows) #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Clic + button
2. Select directories
3. Clic Ok button

What is the expected output? 
jBrout parse directory and add photo

What do you see instead?
Error message :

Traceback (most recent call last):
   File "jbrout.py", line 2428, in on_btn_addFolder_clicked
    self.on_drop_folders_from_os(self.treeviewdb.get_model(),[folder])
   File "jbrout.py", line 1574, in on_drop_folders_from_os
    for nb in iterator:
   File "C:\PROGRA~1\jBrout\app\jbrout\db.py", line 128, in add
    self.__addPhoto( file ,tags,filesInBasket)
   File "C:\PROGRA~1\jBrout\app\jbrout\db.py", line 188, in __addPhoto
    raise err+"\nPhoto has incorrect exif/iptc tags, can't be imported
:\n"+str([file,])
 Traceback (most recent call last):
  File "C:\PROGRA~1\jBrout\app\jbrout\db.py", line 177, in __addPhoto
    needAutoRotation=DBPhotos.autorotAtImport,
  File "C:\PROGRA~1\jBrout\app\jbrout\tools.py", line 176, in __init__
    self.__info = pyexiv2.Image(self.__file.encode("utf_8"))
  File "C:\Program
Files\jBrout\python_runtime\lib\site-packages\pyexiv2.py", line 397, in
__init__
    libpyexiv2.Image.__init__(self, filename)
IOError: D:\Documents\Mes images\Photos Numériques\___Nvelle
Orga\2003\12\20031228 14h29 - Jardin en hiver.jpg: Failed to open the data
source: No such file or directory (2)

Photo has incorrect exif/iptc tags, can't be imported :
[u'D:\\Documents\\Mes images\\Photos Num\xe9riques\\___Nvelle
Orga\\2003\\12\\20031228 14h29 - Jardin en hiver.jpg']

What version of the product are you using? On what operating system?
0.3.163 on windows XP

Please provide any additional information below.
After several test it's due to emphasis (accent en fançais, il me semble
que l'auteur est français..) in path or/and file name

It worked in 0.2 version of jBrout

Thank
Yoann

Original issue reported on code.google.com by yoann.da...@gmail.com on 15 Jan 2009 at 8:39

GoogleCodeExporter commented 9 years ago
It seems it's a trouble in the windows version.
It can't find the file .... (perhaps space or accents in the fullpathname)

we will study it

Original comment by manat...@gmail.com on 15 Jan 2009 at 9:18

GoogleCodeExporter commented 9 years ago
It should be fixed in r165.

In fact, filenames were encoded in UTF8 before calling pyexiv2. Now files stay 
in
unicode.

I don't close the bug ... I wait for you to valid this, because I can't (I 
don't have
windows, and windows versions still don't work in my virtualbox)

Original comment by manat...@gmail.com on 15 Jan 2009 at 9:58

GoogleCodeExporter commented 9 years ago
Still broken in r165, looks like a fault in pyexiv2 or the exiv2 library that 
it is
linked against.  
Will investigate further.  

Original comment by r...@wallace.gen.nz on 16 Jan 2009 at 3:44

GoogleCodeExporter commented 9 years ago
@rob ...

perhaps we should encode 'file' in the filesystem encoding before calling 
pyexiv2.Image()

I'm not at home, but pretty sure it will be better

Original comment by manat...@gmail.com on 16 Jan 2009 at 8:40

GoogleCodeExporter commented 9 years ago
Issue 47 has been merged into this issue.

Original comment by r...@wallace.gen.nz on 21 Jan 2009 at 8:51

GoogleCodeExporter commented 9 years ago

Original comment by r...@wallace.gen.nz on 21 Jan 2009 at 8:53

GoogleCodeExporter commented 9 years ago

Original comment by r...@wallace.gen.nz on 21 Jan 2009 at 9:15

GoogleCodeExporter commented 9 years ago
rob, your answer to issue 43 made me remember that I installed GTK2Runtime
2.14.7-2009-01-13 on 2009-01-18. I was installing Python-Fu in Gimp. Could this
explain why the bug re-appeared?

Original comment by davito...@gmail.com on 21 Jan 2009 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by r...@wallace.gen.nz on 22 Jan 2009 at 6:30

GoogleCodeExporter commented 9 years ago
Have traced this to a bug in pyexiv2, bug report and patch submitted upstream
https://bugs.launchpad.net/pyexiv2/+bug/332419

Presently working on getting out a Windows release with a patched version of 
pyexiv2.  

Original comment by r...@wallace.gen.nz on 21 Feb 2009 at 7:45

GoogleCodeExporter commented 9 years ago
New version of Windows runtime with patched version of pyexiv2 in r180.  

New installer available in the downloads tab.  

The patch for pyexiv2.py is attached for those who prefer to patch their 
existing
installation.  

Original comment by r...@wallace.gen.nz on 21 Feb 2009 at 9:31

Attachments: