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-05-31 12:31

For the widget, I have modded the script to provide this feature Wink

That why I'm testing my mod on Windows and Linux with accented characters.

Glass should be the first skin to provide Random and Last added widget for pictures but other skinners will be able to do the same when Xycl will merge my mod with the next release.
(2012-05-31 12:26)fungify Wrote:  Shouldn't this thread be moved to the forum Picture Add-ons? I would think that many users would like to try the addon, but simple doesn't know it exists. One of the participants of GSOC even seems to be coding a new image database - probably because he didn't know this one exists and works quite well.
Totally agree.

Xycl, I think you should ask to administrator to do this.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Xycl - 2012-05-31 13:44

Request sent to an administrator to move the thread.


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

Same issu with 0.7.7.1 Sad

I have try to scan my pics on my NAS but directory is scanned but no pics is added .

I have install XBMCbuntu over OpenELEC but same issue with NAS scan.


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

OK so 0.7.7.1 work on local pictures, on XBMCbuntu (didn't try on OpenELEC).

Coté.jpg is scanned and displayed.

But on OpenELEC and on XBMCbuntu, SMB directories are scanned but any pics are added.

I will try to debug it if you don't have SMB shared files.


Re: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Martijn - 2012-06-01 02:47

What command is used for scanning through the folder?


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

Commands are os.walk, os.listdir, os.stat and os.path.walk (I hope that I already have an overlook over the source code)

@Mikebzh44: Did you mount the share?
The script is able to access SMB shares directly from a Windows machine but not from Linux.
If the script gets an XBMC source like "smb:/server/share" it tries to connect to "\\server\share". Of course, this only works with Windows and only without user and password.


Edit: I'll try today to access an SMB share from my XBMCbuntu VMware.


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

No, I access my pictures throw SMB path (smb://) like my movies or my music.

I was thinking of mounting smb this morning Big Grin

http://wiki.openelec.tv/index.php?title=Mounting_network_shares

And I think it's the solution for an other problem for me because when OpenELEC boot, SMB sources are not reachable. I have to restart XBMC to watch a film Confused

I will test it this evening.


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

I read a discussion at openelec.tv forum that the netmount.conf no longer works!
Reason was that XBMC is able to access NFS and SMB shares.

The developers of openelec seem to ignore the fact that python addons aren't able to access these shares.
However, see third post in netmount.cfg to mount without netmount.cfg.


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

By the way: The 0.7.1.1 Beta release already contains the filter wizard for tags.

1) Selecting tags of the same type like person A & person B will show pictures that match A or B.
2) Additionally selecting a different tag like cities "Munich, Madrid & New York" will show pictures for (Persons A or B) and (Cities Munich or Madrid or New York)
That means MyPicsDB will show pictures of
Person A and city Munich
or
Person A and city Madrid
or
Person A and city New York
or
Person B and city Munich
or
Person B and city Madrid
or
Person B and city New York

I hope everone will understand the explanation Smile


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

(2012-06-01 08:24)Xycl Wrote:  I read a discussion at openelec.tv forum that the netmount.conf no longer works!
Reason was that XBMC is able to access NFS and SMB shares.

The developers of openelec seem to ignore the fact that python addons aren't able to access these shares.
However, see third post in netmount.cfg to mount without netmount.cfg.
Thanks for this interesting thread.


RE: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Martijn - 2012-06-01 10:31

(2012-06-01 08:07)Xycl Wrote:  Commands are os.walk, os.listdir, os.stat and os.path.walk (I hope that I already have an overlook over the source code)

Those don't work on SMB:// drives

There's a PR pending to extend current xbmcvfs module
https://github.com/xbmc/xbmc/pull/1013

Other option is to use the JSON-RPC to retrieve the files on those drives.
Perhaps this can be usefull?
https://github.com/paddycarey/script.module.devtoolkit


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

The problem is the stat function.
I don't see an xbmcvfs function or json method to replace it.


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

I have always an error with 0.7.1.1 beta under OpenELEC with accented names :

Code:
20:45:22 T:139850233669376   ERROR: Error Type: <type 'exceptions.UnicodeDecodeError'>
20:45:22 T:139850233669376   ERROR: Error Contents: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)
20:45:22 T:139850233669376   ERROR: Traceback (most recent call last):
                                              File "/storage/.xbmc/addons/plugin.image.mypicsdb/scanpath.py", line 510, in <module>
                                                main2()
                                              File "/storage/.xbmc/addons/plugin.image.mypicsdb/scanpath.py", line 150, in main2
                                                count_files(unquote_plus(options.rootpath),recursive = options.recursive)
                                              File "/storage/.xbmc/addons/plugin.image.mypicsdb/scanpath.py", line 217, in count_files
                                                path,folders,files = oswalk(path).next()
                                              File "/usr/lib/python2.7/os.py", line 284, in walk
                                                if isdir(join(top, name)):
                                              File "/usr/lib/python2.7/posixpath.py", line 69, in join
                                                path +=  b
                                            UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)

I think is specific to OpenELEC because Fmronan is running ubuntu, get accented directories name and the script scan his library.

On my OpenELEC, I have mounted my shared directory so now the path for my pictures is /storage/NAS/Pictures.

If I add a subdirectory containing non accented pictures, the scan is OK and DB is populated.

If I add a subdirectory containing accented pictures (Arrière.JPG), the scan is KO.

If I renamed the picture to Arriere.JPG and restart XBMC and rescan directory, everything is OK Confused


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

(2012-05-31 06:42)mikebzh44 Wrote:  How my openelec is set up by default :

Code:
root ~/.xbmc/temp # locale
LC_CTYPE="POSIX"

(2012-06-04 20:54)mikebzh44 Wrote:  
Code:
File "/storage/.xbmc/addons/plugin.image.mypicsdb/scanpath.py", line 217, in count_files
                                                path,folders,files = oswalk(path).next()
                                              File "/usr/lib/python2.7/os.py", line 284, in walk
                                                if isdir(join(top, name)):
                                              File "/usr/lib/python2.7/posixpath.py", line 69, in join

I think "POSIX" is the reason for the decoding.
Setting this in XBMCbuntu will cause the same decoding error.
Can you add
Code:
export LC_ALL="en_US.utf-8"
at the end of your .profile?
But I don't know if openelec support this locale.


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

Yes, Fmronan got the same locale as you :

LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIF

I will try this settings tomorrow morning.