XBMC Community Forum
Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db (/showthread.php?tid=80845)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - mikebzh44 - 2012-06-05 06:47

Try to fix it by setting locale but OpenELEC didn't get all locales :

https://github.com/OpenELEC/OpenELEC.tv/issues/364

As I never use accented charaters in directories or pictures names, it doesn't matter but we should keep this in mind if other users get the same issue.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Xycl - 2012-06-05 08:59

Now we have a problem.

Of course, I can call os.walk with an utf-8 encoded string like os.walk(path.encode('utf-8'), but then it won't work with Windows because there you must use unicodes.
With strings instead of unicodes it works in Windows only with your locale codepage which means that with a german Windows you can read e.g. Coté.jpg (because the é is part of the codepage) but not with a greek Windows! Sad

Okay.
My priorities:
1) The tag filter wizard should go productive.
2) Your functions which set skin properties should go productive.
Todo:
3) An editor to translate the generic tags must be written. The database table already has a column TagTranslation in table TagTypes. You can e.g. use SQLiteSpy to translate the tags.
4) I would like to rewrite the complete scanning stuff with xbmcvfs functions and json GetDirectory. Then you'll be able to scan nfs or smb shares.
Problem: There is no function to get the last modification time. Therefore a rescan will really rescan all pictures and not only the modified onesFrown


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - R00STER - 2012-06-05 14:46

I have a problem running mypictures database on an Openelec system.

When I add a photo source and try a scan it bombs out with:

"Error Script Failed : scanpath.py"

Initially this was from a Samba share but now I have moved all my files locally (which helps with loading time anyway). It doesn't seem to matter what location I try scanning I always get this error.

Anyone able to offer advice?


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - mikebzh44 - 2012-06-05 14:51

Did your directories or picture names is accented or with special characters ?

I have also mount my NAS shared directories to local path but if I scan :

/storage/NAS/Picture/Fazer/Arrière.JPG

then scanpath.py crash. Rename picture to :

/storage/NAS/Picture/Fazer/Arriere.JPG

And scan is OK.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - R00STER - 2012-06-05 15:52

I don't think so, but will have a look.

I did try it on one small folder with no hierarchy and got the same error, but will check the names in it.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - mikebzh44 - 2012-06-05 15:55

Are you running the last stable version or the beta one : http://forum.xbmc.org/showthread.php?tid=80845&pid=1117245#pid1117245 ?

On my OpenELEC (1.95.4) and MyPicsDB-0.7.1.1, scan is OK when picture's name or directory's name is accentless


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - fiveisalive - 2012-06-05 20:34

(2012-06-05 08:59)Xycl Wrote:  4) I would like to rewrite the complete scanning stuff with xbmcvfs functions and json GetDirectory. Then you'll be able to scan nfs or smb shares.
Problem: There is no function to get the last modification time. Therefore a rescan will really rescan all pictures and not only the modified onesFrown

Is this only a problem with scanning files on NFS and SMB, i.e. will the last modification time function work if the files are local? (All my files are local, so this is the only case I care about, since right now, a rescan will scan all files, although it "passes" files already in the database).


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - R00STER - 2012-06-05 23:21

(2012-06-05 15:55)mikebzh44 Wrote:  Are you running the last stable version or the beta one : http://forum.xbmc.org/showthread.php?tid=80845&pid=1117245#pid1117245 ?

On my OpenELEC (1.95.4) and MyPicsDB-0.7.1.1, scan is OK when picture's name or directory's name is accentless
Its the stable version (1.0.2).

I also checked and there are no unusual characters in the picture or directory names, and it still does not work.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Xycl - 2012-06-05 23:21

Of course, there is a loop over all pictures within the given directory. But already scanned pictures (scanning means reading EXIF, IPTC & XMP tags which is quite time consuming) will not be rescanned if they aren't modified.

Currently the picture is loaded and a md5 or sha (I don't remember) is calculated and compared with a stored hash from the database. If the two hashes differ then the tags will be resanned.

When loading pictures from a net share this method is time consuming. Therefore I hoped to compare the mtime of the picture with the stored mtime from database. But this seems not to work.



(2012-06-05 23:21)R00STER Wrote:  Its the stable version (1.0.2).

I also checked and there are no unusual characters in the picture or directory names, and it still does not work.

There is no stable version 1.0.2!
Without any logs we cannot help you.
See: log file

MyPicsDB openELEC beta version 0.7.1.2
Please download MyPicsDB 0.7.1.2 Beta

Every (I hope so) file or directory access is surround with a try/except block. At first MyPicsDB tries to use unicode then after an exception it tries an utf-8 encoded string.
This seems to work in Windows, XBMCbuntu with LC_ALL=POSIX & LC_ALL=en_US.UTF8


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - R00STER - 2012-06-06 00:05

(2012-06-05 23:21)Xycl Wrote:  There is no stable version 1.0.2!
Without any logs we cannot help you.
See: log file
I thought this was 1.0.2:

http://openelec.tv/get-openelec - Current Release: 1.0.2 (1.0 Final)

Anyway, checking the debug and there was some strange text in file_item.py. No idea where that file came from but removing the offending items and the database is now happily scanning away.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - mikebzh44 - 2012-06-06 08:35

1.0.6 is the stable version of OpenELEC (XBMC 10.0 Dharma), I'm running 1.95.4 with is beta 4 for OpenELEC 2.0 (XBMC 11.0 Eden).

0.7.1.1 is the beta version of MyPicsDB addon and 0.6.8 is the stable version.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Xycl - 2012-06-06 17:26

Excuse me but the latest stable MyPicsDB release in my repository is version 0.7.0


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - mikebzh44 - 2012-06-07 11:36

Sorry, my HTPC is not up to date Sad


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - fmronan - 2012-06-09 18:09

I have added the 0.7.1.1 in repo passion because I use this version in my skin, thanks to put your next version 0.7.2Big Grin

http://passion-xbmc.org/addons/?Page=View&ID=plugin.image.mypicsdb


New release 0.7.2 - Xycl - 2012-06-12 21:06

New Release 0.7.2

Fixed: Context menu in browse for tags removed, context menu in tag contents corrected.
New: Method setproperties. See Readme.txt for details.
Fixed: openELEC compatibility for directory and file names with non ASCII characters.
New: New tag filter wizard.