Pictures database and library mode; scan EXIF and IPTC metadata tags into a SQL db

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
Robotica Offline
Posting Freak
Posts: 978
Joined: Aug 2010
Reputation: 3
Post: #131
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....
(This post was last modified: 2010-11-12 15:47 by Robotica.)
find
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #132
cheers it is a great help.
find
fiveisalive Offline
Fan
Posts: 344
Joined: Jul 2009
Reputation: 0
Location: United States
Post: #133
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
find
fiveisalive Offline
Fan
Posts: 344
Joined: Jul 2009
Reputation: 0
Location: United States
Post: #134
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?
find
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #135
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
find
fiveisalive Offline
Fan
Posts: 344
Joined: Jul 2009
Reputation: 0
Location: United States
Post: #136
solexalex Wrote: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.

I worked around by using a "try...except ValueError" construct, but I'll try to use your version to get the debug information for you.

Quote: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

Yep, it does seem to be a skin-specific thing. This worked for me when I was using "Alaska" (at least for the standard Pictures built-in for XBMC), but doesn't work at all (even for built-in Pictures) when using Aeon MQ2. I'll check to see if "O" on the keyboard works even using Aeon MQ2.

One other bug report, when I now select "Add to Collection" using context menu, I get a crash of the entire XBMC. Will try to send a log ASAP.
find
fiveisalive Offline
Fan
Posts: 344
Joined: Jul 2009
Reputation: 0
Location: United States
Post: #137
solexalex Wrote: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.

here's what I get

Code:
23:21:28 T:139693180913424 M:2862854144  NOTICE: MyPicsDB >> SQL > SELECT "Image Rating" FROM files WHERE strPath="/home/myth/media/Pictures/NIKON_D60-2010-06-12-impor
t/100NCD60" AND strFilename="DSC_2714.JPG";
23:21:28 T:139693180913424 M:2862854144  NOTICE: RATING :
23:21:28 T:139693180913424 M:2862854144  NOTICE: Image Rating
23:21:28 T:139693180913424 M:2862854144  NOTICE: <type 'str'>
23:21:28 T:139693180913424 M:2862854144  NOTICE: ----
find
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #138
don t know if it is due to my mobile phone browser or not, but i can t see the whole log (only many notice lines but no informations behind)
I will have a look this evening on my pc.
find
fiveisalive Offline
Fan
Posts: 344
Joined: Jul 2009
Reputation: 0
Location: United States
Post: #139
solexalex Wrote:don t know if it is due to my mobile phone browser or not, but i can t see the whole log (only many notice lines but no informations behind)
I will have a look this evening on my pc.

Here's the extract of the log I posted above in plain text with the timestamps removed:

NOTICE: MyPicsDB >> SQL > SELECT "Image Rating" FROM files WHERE strPath="/home/myth/media/Pictures/NIKON_D60-2010-06-12-import/100NCD60" AND strFilename="DSC_2714.JPG";
NOTICE: RATING :
NOTICE: Image Rating
NOTICE: <type 'str'>
NOTICE: ----
find
solexalex Offline
Skilled Python Coder
Posts: 706
Joined: Jul 2004
Reputation: 6
Post: #140
OK I got it. ( My mobile phone was not showing the horizontal rule to slide the log on the right)

So it is strange... You got, instead of a int for the rating, the name of the field in the database 'Image Rating'
I updated to SVN 144 for you. I hope it solves the problem. I changed the SQLite request

Be carefull I changed some strings once again !
find
Thread Closed