Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db (/showthread.php?tid=80845) |
- solexalex - 2010-09-13 Hi robotica You are doing good to write here your last requests. * Unicode errors in the path are fixed just right now It will be included in the next release. * Datetime errors should be OK now. It tries the standard datetime format (only dots separating the values) and if it does not work, try some others. Sometimes it can't retrieve date time because as what I've seen in some pics, datime is 0000:00:00 00:00:00 and of course it is not a valid date time. * XMP / picture rating I haven't found any pure python library to retrieve XMP metadatas. I would love add this kind of metadatas as it is the most recent kind of information and it works with many different kind of file types. If someone better than I am, knows about such a library, or if somebody knows how to use a XMP C library from python, feel free to contact me ! thank you Picture rating may be done from scratch and only in and for mypictureDB. Anyway, I say it again, it was not in my first thought to enable picture edition from this plugin as it requires a lot of attention to be safe and not corrupt your pics. - Robotica - 2010-09-13 Thnx for fixing that! This EXIF-tool (http://www.sno.phy.queensu.ca/~phil/exiftool/) would be great but it's written in PERL. Maybe when jfcaroll is ready http://forum.xbmc.org/showthread.php?tid=80984 .... Also found this: http://www.zoia.org/blog/2006/08/13/extracting-xmp-metadata-using-python/ - solexalex - 2010-09-13 I don't understand everything he says.... lol Hope it will be usefull later ! unicode problems - mhdebokx - 2010-09-14 As mentioned per e-mail 2 kind of unicode problems occure. I hope there is a solution to translate in ascii strings to unicode If photo's are geotagged using GeoSetter/ExifTools with option save IPTC in unicode, the next error occures: 08:34:53 T:880 M:248811520 NOTICE: MyPicsDB >> >>> DB_file_insert ... 08:34:53 T:880 M:248811520 NOTICE: MyPicsDB >> exceptions.Exception - You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. 08:34:53 T:880 M:248811520 NOTICE: MyPicsDB >> INSERT INTO files('GPS GPSLatitude','category','supplemental category','strFilename','country/primary location name','Image Model','Image Orientation','EXIF DateTimeOriginal','GPS GPSLongitude','UseIt','country/primary location code','EXIF DateTimeDigitized','contact','city','keywords','EXIF ExifImageWidth','idFolder','province/state','EXIF SceneCaptureType','strPath') values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) some camera's also write unicode EXIF information, like the Canon 5D Mark II. The next error occures 08:34:53 T:880 M:248557568 ERROR: Error Type: exceptions.UnicodeEncodeError 08:34:53 T:880 M:248557568 ERROR: Error Contents: 'ascii' codec can't encode characters in position 61-62: ordinal not in range(128) 08:34:53 T:880 M:248516608 ERROR: Traceback (most recent call last): File "C:\Documents and Settings\Michel\Application Data\XBMC\addons\plugin.image.mypicsdb\default.py", line 429, in ? ok = scan_my_pics()#scan lorsque le plugin n'a pas de paramètres File "C:\Documents and Settings\Michel\Application Data\XBMC\addons\plugin.image.mypicsdb\default.py", line 406, in scan_my_pics MPDB.browse_folder(chemin,parentfolderID=None,recursive=xbmcplugin.getSetting(int(sys.argv[1]),'recursive')=="true",update=False,updatefunc = pupdate) File "C:\Documents and Settings\Michel\Application Data\XBMC\addons\plugin.image.mypicsdb\resources\lib\MypicsDB.py", line 466, in browse_folder iptc = get_iptc(dirname,picfile) File "C:\Documents and Settings\Michel\Application Data\XBMC\addons\plugin.image.mypicsdb\resources\lib\MypicsDB.py", line 644, in get_iptc log( "WARNING : '%s' is not a valid IPTC info (value : %s)"%(k,info.data[k][:80]) ) File "C:\Documents and Settings\Michel\Application Data\XBMC\addons\plugin.image.mypicsdb\resources\lib\MypicsDB.py", line 82, in log print str("MyPicsDB >> %s"%msg) UnicodeEncodeError: 'ascii' codec can't encode characters in position 61-62: ordinal not in range(128) 08:34:53 T:3732 M:248442880 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.image.mypicsdb/ 08:34:53 T:3732 M:248442880 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.image.mypicsdb/) failed - solexalex - 2010-09-14 Hum... Your last error looks like an iptc info found in the picture is not valid. I need to test it this evening. I think you sent me this pic and it is a good thing. I'll add it to my library and watch for what is going wrong. - solexalex - 2010-09-15 Hi all V 0.1.3 is available : Code: 2010/09/15 --> v 0.1.3 It should be available from dharma update addons. Hope you like it ! I need your help, this plugin is for you all. So feel free to post your language strings.xml file, report me any bug, anything you like or even you dislike, continue telling me what do you wish for this plugin. Next release (if not too much bugs reported) I will try to add something I think it is a good thing. You should be able to save pics (individually or not) as selections. So you'll be able to make albums, easy then to display some holiday pictures wherever pictures are saved. - Robotica - 2010-09-15 Great! Is it possible to store links to the pics in the database so I don't need to scan my folder everytime (maybe as an option)? And about creating albums... Can you use smart playlists for this so you can combine those pics with other media.. btw: Is there a seperate download for the XBOX-users? - solexalex - 2010-09-15 Robotica Wrote:Is it possible to store links to the pics in the database so I don't need to scan my folder everytime (maybe as an option)?You have this option, it is the last one, and now, it should default to False : Initialize the database before scanning Unmark it and then it should only scan for new pics, and remove pics that are not physically present on your drive Robotica Wrote:And about creating albums... Can you use smart playlists for this so you can combine those pics with other media..Why not. Do you know a format for this ? Does XBMC play pictures smartplaylists ? If it is doable, then I may do that after 'picture selection' stuff Robotica Wrote:btw: Is there a seperate download for the XBOX-users?No unfortunately no... It would take me too much time to maintain the plugin for both XBMC version (pre-dharma and post dharma) If someone fill like doing a xbox version, feel free to tell me, would love to talk about it ! - Robotica - 2010-09-15 beta1 worked fine on XBOX... - solexalex - 2010-09-15 yes, the very first release was pre-dharma. But from this time I made many change, including necessary changes for dharma addon system. (Oh, I hope I did'nt missed a news telling dharma was ported to xbox as well !!!) - solexalex - 2010-09-16 known bug : if you choose a month from the 'by dates' filter, and you have any picture in this month, shooted the last day of the month, it bugs. It is because to select a whole day of pictures, I take all the pictures dated between the given day of the month, and the given day +1. So if the month contain only 30 days (for example April) it selects pics from yyyy/04/30 to yyyy/04/31, which python time module says to be wrong (of course) The correct thing should be 04/30 to 05/01 for a whole day... I have to fix that. Tonight I made something to sort pictures from any date to any other, so that you can easily sort all pics for a whole WE or all pics of you whole holidays. You'll have to wait for next release or check my svn : https://xbmc-scripts.googlecode.com/svn/branches/addons/plugin.image.mypicsdb dutch translation - mhdebokx - 2010-09-16 dutch translation is send to your email adress in the next release this will be available - pko66 - 2010-09-16 Just a suggestion, maybe is stupid at this point, but... Both the picasa application and picasa web allow face recognition and (partially automatic) naming of the people in each picture, and it works pretty well, I have like a thousand photos face and name tagged. It would be great to have that information imported somehow into the database - Robotica - 2010-09-16 @pko66: Facebook does that also... - ppic - 2010-09-16 the plugin already read tag, so if picasa tag the picture, it will be available in the plugin. |