Kodi Community Forum

Full Version: MyPicsDB: Pictures DB with EXIF, IPTC & XMP tags
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Yes...so cool. It work perfectly.Rofl
Thank a lot
What changes need to be made to work with Gotham Dev Builds? A post on the 12.0.0 release suggested you plan on a 13.0 version for it. Just installed the RBEJ Gotham, so now my MyPicsDB doesn't work.
As long as Gotham is in early alpha status I won't change anything in MyPicsDB.
The Gotham migration will begin with the first Gotham RC.
MyPicsDB Version: 12.0.0
MySQL version: 5.5.17

Hey Xycl, I'm getting the following error when MyPicsDB scans my pictures. This error causes over 8000 of my 11000+ pictures to NOT get inserted into the database because the Date Taken tag is empty.

11:35:55 T:700 ERROR: [plugin.image.mypicsdb] line 440 in MypicsDB.py object file_insert >> <type 'exceptions.Exception'> - 1292: Incorrect datetime value: 'null' for column 'ImageDateTime' at row 1

After a little investigation I was able to resolve this problem on my own by making the following change in the MypicsDB.py file at line 418.

Changed line 418
From:
imagedatetime = "null"
To:
imagedatetime = "0000-00-00 00:00:00"

You may have already fixed this in a newer version but thought I'd mention it in case there are others out there pulling their hair out trying to figure out why their pics arent being inserted that may have a similar setup.

Thanks for all your hard work!
Thanks.

I didn't know about this error.
Fixed in new 12.0.4 version in my repo.

Xycl
Updating the database with a large number of pictures is mind-numbingly slow especially if there are only a handful of pictures that are new or updated. If i'm not mistaken, and please correct me if I am, the script is walking through each path and checking each picture to determine which files are new or have been modified to update or insert into the database.

Have you given much consideration to implementing a "quick scan" feature that uses the parent folder modification date instead? The parent folder modification date should reflect any child files that have been modified. This would quickly rule out unnecessary image scans in folders that have not been modified since the last scan and speed up the scan significantly.
The xbmcvfs (virtual file system) module doesn't contain a stat (or similar) function.
There is no function to get a modification, creation or whatever file/directory date.

To determine a changed picture a hash value is calculated and stored into the DB.
In case of remotely stored pictures that means that each picture has to be send to your XBMC machine.
The built-in os.path functions will return creation and modification times.

os.path.getmtime(path) #modification time
os.path.getctime(path) #creation time
os.path.getatime(path) #time of last access

I've partially implemented this on my local machine. So far it's working well but still have a long way to go for full implementation.

If you dont mind, i have another feature request.

Please add strPath and ftype as tags. You're currently excluding both tags in the mypicsdb.py tags_insert function. I can only speak for myself but I have to believe there are many others out there that find tagging pictures to be a painful exercise and instead store my pictures based on folder hierarchy.

For example:
Pictures\
Pictures\destinations\
Pictures\destinations\Argentina\
Pictures\destinations\Argentina\Buenos Aires
Pictures\destinations\Argentina\Iguazu
Pictures\destinations\Europe\

The Browse by Folder selection is meant to address this but is limited by only being able to view one folder at a time, and more importantly, it cannot be used in combination with the Filter Wizard. By adding the strPath tag you'd allow us to search by multiple path locations in addition to other tags as well.

Similarly the ftype tag would allow us to include/exclude movie/picture items from our searches. Both tags would grant us a lot more flexibility in our filter wizard searches.

Really great work by the way. IMO MyPicsDB is arguably the single most useful addon for XBMC and really should be included in xbmc core as the default interface for viewing pictures.
(2013-08-11, 20:42)Zeddd Wrote: [ -> ]The built-in os.path functions will return creation and modification times.

os.path.getmtime(path) #modification time
os.path.getctime(path) #creation time
os.path.getatime(path) #time of last access

I've partially implemented this on my local machine. So far it's working well but still have a long way to go for full implementation.

These functions will return the times of locally stored files and directories.
What is with files stored on a NAS and directories which aren't mounted locally (Linux, MacOS) or accessed with a drive character (Windows)?

One big change of MyPicsDB was to support xbmcvfs module. Your're able to use remote sources with smb, nfs, zeroconf etc which is not nativly supported by Python file functions.

(2013-08-11, 20:42)Zeddd Wrote: [ -> ]If you dont mind, i have another feature request.

Please add strPath and ftype as tags. You're currently excluding both tags in the mypicsdb.py tags_insert function. I can only speak for myself but I have to believe there are many others out there that find tagging pictures to be a painful exercise and instead store my pictures based on folder hierarchy.

For example:
Pictures\
Pictures\destinations\
Pictures\destinations\Argentina\
Pictures\destinations\Argentina\Buenos Aires
Pictures\destinations\Argentina\Iguazu
Pictures\destinations\Europe\

The Browse by Folder selection is meant to address this but is limited by only being able to view one folder at a time, and more importantly, it cannot be used in combination with the Filter Wizard. By adding the strPath tag you'd allow us to search by multiple path locations in addition to other tags as well.

Similarly the ftype tag would allow us to include/exclude movie/picture items from our searches. Both tags would grant us a lot more flexibility in our filter wizard searches.

Really great work by the way. IMO MyPicsDB is arguably the single most useful addon for XBMC and really should be included in xbmc core as the default interface for viewing pictures.

I'll look on it.
Hi Xycl and thanks for a great plugin!

This might be a stupid question, but is there a good reason for the exif-parser to open the file with "modify" permissions? Specifically, I'm referring to lines 395 and 397 in scanpath.py:
Code:
try:
            f=open(picfile,"r+b")
        except:
            f=open(picfile.encode('utf-8'),"r+b")
Since I run xbmc as a separate user on my computer I thought read permission would be enough to scan my pictures. If I change these lines to:
Code:
try:
            f=open(picfile,"rb")
        except:
            f=open(picfile.encode('utf-8'),"rb")
I no longer get a permission error and the EXIF-data is imported correctly. And again, a big THANK YOU for all the effort you have put into this plugin.
Hi ggubben,

the reason is grr's post to use memory mapped files.
This only works on Windows with enabled modify flag.

Xycl
(2013-08-11, 20:42)Zeddd Wrote: [ -> ]The built-in os.path functions will return creation and modification times.

os.path.getmtime(path) #modification time
os.path.getctime(path) #creation time
os.path.getatime(path) #time of last access

Gotham
I found:
st = xbmcvfs.Stat(path)
modified = st.st_mtime()

That means that only a "special" MyPicsDB Gotham release will support the modification time verification.
With 1st Gotham RC I'll release this MyPicsDB.
(2013-07-30, 04:22)euphos Wrote: [ -> ]What changes need to be made to work with Gotham Dev Builds? A post on the 12.0.0 release suggested you plan on a 13.0 version for it. Just installed the RBEJ Gotham, so now my MyPicsDB doesn't work.

I installed Alpha 7 in portable mode (Windows) and MyPicsDB works.
MyPicsDB 12.1.0

available in my repository.

It contains a lot of bug fixes introduced with the DB abstraction layer used for the MySql connectivity in version 12.0.0. ( which is and will forever be the last one in official XBMC repository. EDIT It is already removed. )
MyPicsDB 12.1.3

available in my repository.

(2013-08-06, 08:08)Zeddd Wrote: [ -> ]Updating the database with a large number of pictures is mind-numbingly slow especially if there are only a handful of pictures that are new or updated. If i'm not mistaken, and please correct me if I am, the script is walking through each path and checking each picture to determine which files are new or have been modified to update or insert into the database.

Have you given much consideration to implementing a "quick scan" feature that uses the parent folder modification date instead? The parent folder modification date should reflect any child files that have been modified. This would quickly rule out unnecessary image scans in folders that have not been modified since the last scan and speed up the scan significantly.

Menu "Paths of picture folders"->"Search for new pictures" which only looks for new pictures and ignores already available ones. It's much faster.

(2013-08-11, 20:42)Zeddd Wrote: [ -> ]...

Please add strPath and ftype as tags. You're currently excluding both tags in the mypicsdb.py tags_insert function. I can only speak for myself but I have to believe there are many others out there that find tagging pictures to be a painful exercise and instead store my pictures based on folder hierarchy.

For example:
Pictures\
Pictures\destinations\
Pictures\destinations\Argentina\
Pictures\destinations\Argentina\Buenos Aires
Pictures\destinations\Argentina\Iguazu
Pictures\destinations\Europe\

The Browse by Folder selection is meant to address this but is limited by only being able to view one folder at a time, and more importantly, it cannot be used in combination with the Filter Wizard. By adding the strPath tag you'd allow us to search by multiple path locations in addition to other tags as well.

Similarly the ftype tag would allow us to include/exclude movie/picture items from our searches. Both tags would grant us a lot more flexibility in our filter wizard searches.

Really great work by the way. IMO MyPicsDB is arguably the single most useful addon for XBMC and really should be included in xbmc core as the default interface for viewing pictures.

File type and picture path now available as tag to use it in Filter Wizard.