Kodi Community Forum
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)

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


- mhdebokx - 2010-11-07

solexalex Wrote:I added in the code the ability to exclude a path from the scan.

That is great news. I'm waiting till the next beta version!


- solexalex - 2010-11-07

Another great news ?
I codded the things to set up the excluded paths. It is in the same place as the paths to scan.
Paths to scan are prepend with a green plus sign.
Paths to exclude are prepend with a red minus sign.
They all shown in the same place and i don t like it very much and may change this later. I will wait for your feedbacks first.

I think about adding a system of keyword exception so that picture name containing one of setted keyword exclusion will be excludefrom scan too


- The-Boxhead - 2010-11-07

Great work Guys ! very much appriciated. !
I understand it's not finished but just keep this as a
future sugestion Smile

As a future request, im a hobby photografist and togheter
with all my regular jpg's i keep a folder with the raw images. Raw
images are larger files that comes straight out of a camera without any
post processing and are quite large. Raw files can have different file extensions depending on the brand of camera used.

A function to automaticly exlude raw data files would be great. Instead
of me manually exluding all the folders with raw files in them.

List of suggested excludes:
*.CR2 (Canon)
*.CRW(Canon)
*.NEF (Nikon)
*.DNG (Adobe)
*.RAF (Fuji)
*.DCR (Kodak)
*.MRW (Minolta)
*.ORF (Olympus)
*.PEF (PentaX)
*.SRF (Sony)

By having an option to exclude these types i don't get duplicates
and it speeds up the scanning. And i dont get dupes of all my images.

Boxhead.


- solexalex - 2010-11-07

Hi !

What is sometimes a bad thing, is sometimes a good thing.

The way I detect picture files is only based on the file extension.
Right now it is only hardcoded and these are extensions that will be scanned for exif and IPTC datas (note that a picture of any kind with not any of the exif nor IPTC metadatas will be added in the database, but maybe never shown in any results as many of them are based on one of the metadatas informations)
Code:
listext = [".JPG",".TIF",".PNG",".GIF",".BMP",".JPEG"]
(the case is no matter)

So in your case raw files should never be scanned. Maybe someone will tell me it is not a good idea and would want to handle raw files but... that's all I can do for the moment. Waiting for a way to edit files extension, users will have to edit the script.

Another way to detect file extension is ... I don't know. It may be based on the file content... that's why I can't do it, just because I don't know how it works.
Using simply the file extension, is pretty simple enough and does not consume too much processing time


- solexalex - 2010-11-08

OK
I added the list of picture extension in the plugin settings.
Extensions are pipe separated and editable through the virtual keyboard.

I updated the svn (rev137) for those who follows it. Only the french strings.xml is uptodate, and other languages should be TOTALLY updated as many strings changed


- solexalex - 2010-11-09

Now I sorted a little bit the root paths to scan for pictures, then the excluded paths which should not be scanned.
It is much better.
I added a context menu that enables, from the 'sort by folder' view, to add directly from here a folder in the exclude list Smile


- fiveisalive - 2010-11-10

solexalex Wrote:Now I sorted a little bit the root paths to scan for pictures, then the excluded paths which should not be scanned.
It is much better.
I added a context menu that enables, from the 'sort by folder' view, to add directly from here a folder in the exclude list Smile

SVN update seems to work mostly fine (had to remove and rescan my database to get it to recognize new images since there was a new column). I have one issue in that 63 pics seem to be being recognized as "new" on every scan, despite the fact that they've already been added. I'll see if I can isolate on example.

Other bits that would be nice to implement/fix:

  1. "Start Slideshow" should be added as a context item to all menus, i.e. not just within a list of pictures. I'd like to be able to go to "Oct 2010" (say) and right-click context menu and get a slideshow of all images from Oct 2010 without having to actually enter that album. Ditto for any level, e.g. a whole year, month, or day.
  2. Ditto the above for "Add to Favorites". In other words in any place you have "Add to Collection" should also appear "Add to Favorites" and "Start Slideshow" and any other items that make sense to operate on a list of photos/images.
  3. Editing dates in period is a little odd. It seems you always have to type the date, but there should be an option to choose the date from a list, like you can when you initially create the period. On that subject, in English perhaps "Time Interval" would be a better translation than "Period".



- solexalex - 2010-11-11

Hello
1 and 2 :
problem with slideshow over a folder item, is that the slideshow will check any of item in the folder.
For a keyword, no problems, every keyword contain only some pics with no sufolders
For date, a folder may contain a subfolder with some other subfolders.. and some pictures. But it contains as well the item you find in any subfolder which is the item to show all the pictures for the given date.
So for every folder, XBMC restarts in background the plugin in a loop to get recursively all the available pictures. The results is that a progress bar appear/disapear everytime the loop scan a subfolder and many pictures are duplicates because of the 'show all' items

This is the same for the folderview. The gui shows/hides/shows/hides... a progress bar for every subfolders. It finally looks uggly.

So I coded my own way to manually add only pictures and I will see later how to improve the diaporama context menu item


- Robotica - 2010-11-12

Since this project is adding a new picture experience to XBMC (and it's database in specific) I wonder:

This topic is discussing future database backend implementation. The picture library isn't within the scope. To me, it looks very useful to share all experiences from those topics so all aspects of a media database are considered.


- solexalex - 2010-11-12

oh well. It is a very good idea. But as english is not my first language, i don t feel to read the whole conversation.

Do you know if there is something to do to ask for thinking about a picture database ?

Sorry for being lazy on this but reading only the first topic is a hard work for me Wink


- Robotica - 2010-11-12

don't be sorry since sharing this work is great. Can't do all...

I will step in that topic and ask what is needed and then I will come back here.

As for mySQL support: I think this is hard to test since this plugin uses a seperate database. Maybe I am wrong....


- solexalex - 2010-11-12

cheers it is a great help.


- fiveisalive - 2010-11-14

There appears to be a problem with the getting of ratings from pics that don't have ratings, here's the traceback (this is with SVN r143):

Code:
22:09:50 T:140404287993616 M:2880163840  NOTICE: MyPicsDB >> SQL > SELECT "Image Rating" FROM files WHERE strPath="/home/myth/media/Pictures/Lumix-import-old/108_PANA"
AND strFilename="P1080365.JPG";
22:09:50 T:140404287993616 M:2880163840  NOTICE: rating
22:09:50 T:140404287993616 M:2880163840  NOTICE: Image Rating
22:09:50 T:140404287993616 M:2880163840    INFO: -->Python script returned the following error<--
22:09:50 T:140404287993616 M:2880163840   ERROR: Error Type: exceptions.ValueError
22:09:50 T:140404287993616 M:2880163840   ERROR: Error Contents: invalid literal for int(): Image Rating
22:09:50 T:140404287993616 M:2880163840   ERROR: Traceback (most recent call last):
                                              File "/home/myth/.xbmc/addons/plugin.image.mypicsdb/default.py", line 1027, in ?
                                                m.show_pics()
                                              File "/home/myth/.xbmc/addons/plugin.image.mypicsdb/default.py", line 980, in show_pics
                                                fanart = xbmcplugin.getSetting(int(sys.argv[1]),'usepicasfanart')=='true' and join(path,filename) or picfanart
                                              File "/home/myth/.xbmc/addons/plugin.image.mypicsdb/default.py", line 160, in addPic



- fiveisalive - 2010-11-14

Another small feature request: in the standard "Pictures" in XBMC, when you are viewing a picture fullscreen, you can click the context menu and it will display the EXIF data on the image (e.g. time and date, and camera etc.) could you also enable this for full screen within the plugin?


- solexalex - 2010-11-14

fiveisalive Wrote:There appears to be a problem with the getting of ratings from pics that don't have ratings, here's the traceback (this is with SVN r143):

I think it is because of pics which contain something in the rating field, but this thing is not a number. or looks not like an integer number.
Can you change a bit the code for me ?
line 160 you have :
Code:
if rating: prefix = prefix + "[color=C0FFFF00]"+("*"*int(rating))+"[/color][color=C0C0C0C0]"+("*"*(5-int(rating)))+"[/color]"
Change it for :
Code:
if rating:
            print "RATING :"
            print rating
            print type(rating)
            print "----"
            prefix = prefix + "[color=C0FFFF00]"+("*"*int(rating))+"[/color][color=C0C0C0C0]"+("*"*(5-int(rating)))+"[/color]"
There should be the error but I can't figure why. The rating that my lib get should be strange, so I need to know what it is exactly.

fiveisalive Wrote:Another small feature request: in the standard "Pictures" in XBMC, when you are viewing a picture fullscreen, you can click the context menu and it will display the EXIF data on the image (e.g. time and date, and camera etc.) could you also enable this for full screen within the plugin?
I don't know which skin you are using, but the contextmenu you are talking about comes from the skin.
I'm using PM3 and I don't have such context menu while watching a picture full screen.
I can have a look but tell me what is you skin.
Anyway, you can get exifs infos while watching a picture full screen using 'O' key on the keyboard.
If you want to know exif info of a picture in a list, you can press 'I' key on your keyboard. These shortcuts, I think, are not dedicated to any skin... or not... lol