peircej / jbrout

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

Lack of date in db.xml will crash jbrout #170

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open db.xml in a text editor
2. In a <photo> empty or remove the date attribute
3. Launch jbrout

After having imported photos under Win XP with JBrout 0.3.282.
When i try to run it again, it says a python error then says "JBrout exited 
with error code -10 do you wish to view the log file?"
In the log file is the python error, which is:

Traceback (most recent call last):
  File "jbrout.py", line 3011, in <module>
    main()
  File "jbrout.py", line 2984, in main
    window = Window()
  File "C:\PROGRA~1\jBrout\app\libs\gladeapp.py", line 125, in __init__
    obj(*(args),**(dargs))
  File "jbrout.py", line 1118, in init
    m.init()
  File "jbrout.py", line 380, in init
    years=list(set([int(i.date[:4]) for i in ln]))
ValueError: invalid literal for int() with base 10: ''

So i opened db.xml and found some photos with date="".
I removed from the file all the entries with no date.
I ran again jbrout and it worked.

So, jbrout need to verify the presence of a date before parsing it.
(You can have two different errors: if the date attribute is absent or if it's 
empty)

Original issue reported on code.google.com by p...@gmx.fr on 11 Oct 2010 at 10:34

GoogleCodeExporter commented 8 years ago
no ...

In fact ... jBrout shouldn't save db.xml with photo's nodes with empty dates.
In fact, it shouldn't try to save pictures with no dates, at import time.

Original comment by manat...@gmail.com on 11 Oct 2010 at 5:54

GoogleCodeExporter commented 8 years ago
can you send me a picture which makes jbrout save a photo's node with empty 
date at import time ?

Original comment by manat...@gmail.com on 11 Oct 2010 at 6:33

GoogleCodeExporter commented 8 years ago
Oh i found it.

Just import a file without exif info and read-only.

(In general, read-only files are bugging jbrout. If you select a lot of files 
with ONE read-only, you can't apply all functions and the right click menu is 
reduced to the read-only functions, very boring if you want to build all 
thumbnails)

Original comment by p...@gmx.fr on 12 Oct 2010 at 10:15

GoogleCodeExporter commented 8 years ago
Yes !
you find it !
I reproduce it everytime now !

But what can I do with a picture which doesn't have EXIF, when jBrout can't set 
them because the file is readonly ?!?
Since some times : jBrout always use exif... and if picture doesn't have them, 
jBrout build them (fake one), to be able to manage the picture (exif 
thumbnails, efix dates ...)!

I vote for an "import error" ! no ?

Original comment by manat...@gmail.com on 14 Oct 2010 at 6:43

GoogleCodeExporter commented 8 years ago
fixed in r316 ...

Now jBrout can't import pictures which don't have EXIF if the picture is not 
writeable. Because jBrout needs a minimal exif set, if it can't set them 
(minimal exif set) at import time, because the file is not writeable : it 
breaks the import (like it breaks when a file is bad).

thanks to you !
Now, we can say that this error will never be here again !

Original comment by manat...@gmail.com on 14 Oct 2010 at 9:28

GoogleCodeExporter commented 8 years ago
Maybe you shouldn't break the import if a file is bad.
Better enter in the db the modified file date.
Or accept a file without date.

And maybe asking the user if he wants to remove the readonly attribute from all 
the files before input.

Original comment by p...@gmx.fr on 15 Oct 2010 at 12:21