brunolojor / jbrout

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

Yet another import issue #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. import pictures
2. see the import error dialog

What is the expected output? What do you see instead?
I see:
    File "jbrout.py", line 2413, in on_btn_addFolder_clicked
    self.on_drop_folders_from_os(self.treeviewdb.get_model(),[folder])
   File "jbrout.py", line 1575, 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 !!"
 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 218, in __init__
    self.__refresh()
  File "C:\PROGRA~1\jBrout\app\jbrout\tools.py", line 269, in __refresh
    self.__comment = self.__info.getComment().decode("utf_8")
  File "C:\Program Files\jBrout\python_runtime\lib\encodings\utf_8.py",
line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 5-7:
invalid data

What version of the product are you using? On what operating system?
Windows XP SP3 jBrout revision 174

Please provide any additional information below.
I am currently trying to track down the "faulty" pictures.

Original issue reported on code.google.com by davito...@gmail.com on 3 Feb 2009 at 11:21

GoogleCodeExporter commented 8 years ago
BTW, once again jBrout does not display the name of the picture. So I have to 
sift
through hundreds of pictures to find which ones are triggering the problem.

Original comment by davito...@gmail.com on 3 Feb 2009 at 11:57

GoogleCodeExporter commented 8 years ago
I found one picture, but there are many others. I suggest you should keep a 
database
of pictures submitted which triggered errors. This will make a good test!

Original comment by davito...@gmail.com on 3 Feb 2009 at 12:09

Attachments:

GoogleCodeExporter commented 8 years ago
This looks like an error decoding the file name and/or path rather than 
problems with
the file itself as the error shown here is inside the statement that is raising 
the
initial error and trying to display the file name.  

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

GoogleCodeExporter commented 8 years ago
Sorry, but you are wrong. 

jBrout correctly imports/refreshes the folder as long as the "bad" pictures 
aren't
there, but shows an error as soon as I put this picture in the folder. So the 
path is
not the cause of the problem.

As for the file name, I fail to see why jBrout would have issues with 
"A171_IMG.JPG"
but not with "A150_IMG.JPG" or with "A237_IMG.jpg"... As you can guess, I don't
rename pictures, I use the keywords and EXIF data for all identification 
purposes ;-)

I'd like to help you pinpoint the problem, but I don't know Python. I am a 
programmer
though, and I know Pascal and PHP and a little about how EXIF and IPTC work. 
These
transcoding issues shouldn't be too difficult to find even for an absolute 
beginner.
Is there a debugger running on Windows XP I can install to track down the cause?

Original comment by davito...@gmail.com on 5 Feb 2009 at 10:28

GoogleCodeExporter commented 8 years ago
The IDE that I use for Python is called is SPE (Stani's Python Editor), this is
available at http://pythonide.stani.be/ this includes a python debugger called 
winpdb
which is itself written in Python and so is cross platform.

Original comment by r...@wallace.gen.nz on 6 Feb 2009 at 8:54

GoogleCodeExporter commented 8 years ago
Thanks for the info. I downloaded SPE. I'll try to test it this weekend.

Original comment by davito...@gmail.com on 6 Feb 2009 at 9:23

GoogleCodeExporter commented 8 years ago
any news on that issue ?

Original comment by tbenita on 12 Jul 2009 at 9:00

GoogleCodeExporter commented 8 years ago
No. I tested rob's environment and I was disappointed. I was hoping for a 
debugger,
but either it isn't there or I couldn't find it. I tried a few others IDEs too
without finding what I was looking for and then I got caught by other things. I
expect to have some time in about one month. Then I'll try to find what is 
happening
here.

Original comment by davito...@gmail.com on 15 Jul 2009 at 8:11

GoogleCodeExporter commented 8 years ago
If you wish to debug, insert this line before where you want to have a 
breakpoint : 
import pdb;pdb.set_trace()
This will open a prompt and give you access to a step-by-step. 'help' will 
provide
you the list of available commands.
dir() -> list of available variables
dir(object) -> list of methods and attributes of the object
print myvar -> print the content of myvar
type(myvar) -> class of myvar

Good luck !

Personally I use komodo ;)

Original comment by tbenita on 15 Jul 2009 at 9:33

GoogleCodeExporter commented 8 years ago
Looks like how I used to debug in Assembly 20 years ago :-D Ok, for import 
errors,
it'll do. But I wouldn't want to debug event-driven user-interacting pieces of 
code
with this :-D

Original comment by davito...@gmail.com on 15 Jul 2009 at 10:27

GoogleCodeExporter commented 8 years ago
Re-tested this issue on the same picture and the bug isn't there any more. So it
seems I won't debug this one :-)

Original comment by davito...@gmail.com on 21 Jul 2009 at 9:07

GoogleCodeExporter commented 8 years ago
seems like errors like this mostly occur when the photos exif tags contain 
characters like \x03 \x00 \x05
maybe the decode("utf_8") should be replaced by decode("utf_8", "ignore") - all 
the bad character should 
be skipped then

Original comment by lome...@googlemail.com on 13 Oct 2009 at 4:41

GoogleCodeExporter commented 8 years ago
was fixed in trunk by manatlan in january

Original comment by tbenita on 1 Nov 2009 at 12:15