• 1
  • 6
  • 7
  • 8
  • 9
  • 10(current)
Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db
ran into a couple problems:

1) If the date field in the picture is something invalid (like 0000:00:00 00:00:00) it crashes. Added try/except around line 547 in MypicsDB and it works now.
2) Maybe related to first problem, but I didn't get any listings under "sort by date" because of null fields. Removing check "if not None in listperiod:" in default.py, 199 seems to work, but may have broken something else.
3) Sort by folders seems to be broken if you have a root path with no pictures and only subfolders
Reply
1) I added this date format in an except statement, so that if the standard format is not recognized, this other one is used (hopefully no other format exists. If so, I would code something more efficient)

2) maybe, Robotica sends me pics with such a date format. Didn't took time to test yet. Will do very soon and I will tell you if it works or not

3)I do have a root path with only subfolders and it works. If the problem persists, maybe would you send me your database to check
Reply
Could you please upload a fixed version to the repository?
Reply
I got this to work after quite a bit of fiddling (I am using the version just released to the addons repository with Dharma). It seems that the picture detection algorithm is pretty fragile. It simply looks for files with extension ".jpg". This means that it misses pictures with ".JPG" (which matters on Linux/Unix platforms that are case-sensitive). I hacked the code from

Code:
listfolderfiles = fnmatch.filter(listdir,"*.jpg")

to

Code:
listfolderfiles = fnmatch.filter(listdir,"*.JPG")

Also it won't detect many other picture types that xbmc-proper handles such as .gif, .png etc. Perhaps there are some better python functions that can detect whether a file is an image file based on /etc/magic and file type rather than fragile file extensions, that will detect images that don't have any extension?

Another question: how do you set/remove keywords?
Reply
Another issue is that if I leave the plugin and go back to the Home screen, then re-enter the plugin, it seems to rescan my entire directory again, taking as much time as the first time I created the db. I thought the sqlite database would cache this info. This is my settings file:


Code:
<settings>
    <setting id="initDB" value="true" />
    <setting id="recursive" value="true" />
    <setting id="scanfolder" value="/home/foobar/images/107_PANA/" />
    <setting id="updateDB" value="false" />
</settings>
Reply
First of thanks for all your feedbacks. I feel happy of the interest you give to this addon.

I made a pull request to xbmc team yesterday but the new version is not in the repo yet. I `m going to work now and you will have to wait about 8 hours to expect any new version... Sorry

jpg , JPG
I'll make this better tonight. Don't expect other file extension or other way to detect jpg files yet. It should be harder to handle but it may be for a futur version, why not if needed.

Gif, png, ...
Wont be used as they dont contain any exif nor iptc metadata (correct me if i'm wrong). Maybe they can have xmp metadata but i didn't found any xmp python library to handle them.
Videos are not scanned neither for same reasons. But i may do a trick to add those in the database as many camera can take videos too.


Rescan on each execution.
You have an option in the plugin settings. Dont have in my mind the exact label for it. It is an option i kept for developping purpose to detect potentially scanning errors.

Adding or removing keywords , or widely edit pictures metadata.
It is not the goal of this plugin as many picture manager software do the job really well (And I m pretty sure many of us use one of those)
Reply
Official repository update.
My pictures database v0.1.2 is available
Reply
fiveisalive Wrote:I got this to work after quite a bit of fiddling (I am using the version just released to the addons repository with Dharma). It seems that the picture detection algorithm is pretty fragile. It simply looks for files with extension ".jpg". This means that it misses pictures with ".JPG" (which matters on Linux/Unix platforms that are case-sensitive). I hacked the code from

Code:
listfolderfiles = fnmatch.filter(listdir,"*.jpg")

to

Code:
listfolderfiles = fnmatch.filter(listdir,"*.JPG")

Also it won't detect many other picture types that xbmc-proper handles such as .gif, .png etc. Perhaps there are some better python functions that can detect whether a file is an image file based on /etc/magic and file type rather than fragile file extensions, that will detect images that don't have any extension?
What do you think of :
Code:
for f in listdir:
        if os.path.splitext(f)[1].upper() in [".JPG",".TIF",".PNG"]:
            listfolderfiles.append(f)
That way I got every file with extension made upper that equal to one of those JPG, TIF or PNG.
Anyway I don't have exif or iptc infos from these file types.
If you have tif, gif, png or whatever pic files with IPTC/EXIF you can send to me a sample I'll add it to my set of testing pictures.
Reply
I am using the Dharma version on Windows 7, first of all thanks for all the effort. Unfortunately the scanner doesnt complete a full scan, but crashes somewhere halfway. The collection is around 15.000 photos and resides on another Windows 7 machine. Please inform what info I could provide to troubleshoot.
Reply
I already noticed crash while scanning large pictures collection but did not notice that since dharma release.
You use 2 potentialy source of problem.
First one is the share.
Second one is the large collection.

I'll try to know whats your problem.
First, restart the plugin while full log activated (look on the wiki to know how activate logging from XBMC and get the XBMC.log file.) When you've got this log file, send it to me, contact me by PM if you need my email adress or post your log in this topic.
Send me your picture database you'll find in XBMC\userdata\Database\MyPictures.db. That way I know a bit more about how many pictures were scan before the crash append and maybe which picture was the last scanned.

Then you may try some things to make it working (just if you want to see how it works and if you like the plugin or not)

- After scanning, it crash, then edit the plugin settings and set the choice "Initialize the database before scanning" to false (unmark it). That way you whole database will not be refilled, but only new pictures found will be added. If you see it loads some more pictures it is a good sign, if not, it may be only one picture that crash the plugin. The log will tell me that.

- If it still does not work, it may be because of your share. I think you mount your W7 share as a virtual drive and you scan this drive for pictures. if true, maybe you can try to install XBMC with MyPicsDB plugin and scan the local path for pictures. If it works, the error may be because of the share, if not,... I'll have to ffind something else !! Smile

Hope to hear from you soon
Reply
I just seen that this topic was not in python development section. That's why I started a new thread :
http://forum.xbmc.org/showthread.php?p=602333

Feel free to continue started conversations here and start new question, requests... concerning this plugin on the new thread
Reply
  • 1
  • 6
  • 7
  • 8
  • 9
  • 10(current)

Logout Mark Read Team Forum Stats Members Help
Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db2