Designing metadata storage

Started by mrbrahman, May 24, 2018, 02:03:32 PM

Previous topic - Next topic

mrbrahman

Hi,

I would like to gather some thoughts on designing a metadata storage system using Exiftool.

I'm trying to achieve the below objectives:

1. Delta updates during re-scan
2. Ability to search on the metadata
3. Ability to treat multiple values in search for e.g.
       face="nameX|nameY" will fetch all photos having nameX or nameY. Similarly
       face="nameX,nameY" will fetch all photos having nameX and nameY
       face="nameX&nameY" will fetch all photos having ONLY nameX and nameY (and no one else)


Currently, I designed a system that grabs metadata by folder using exiftool command line, and stores this as a file in the same folder structure as the original folder. With this, I'm able to find out if a particular folder has changed, and only grab the metadata for those folders. Attached is the "grab_meta.sh" script for reference.

For search, I have a Perl script that goes against the metadata files I collected, and perform the required search. Also attached for reference. (Disclaimer - I'm still learning Perl  :D )

The idea here is to search metadata on the required criteria, and pipe the file names to something like feh to display a slideshow, or create links for xScreensaver GLSlideshow.

I would like to get other thoughts on designing such a system, using either exiftool command line or Image::Exiftool.

FYI - I explored storing metadata in SQLite, as SQLite has support for JSON datatype, but looks like it doesn't provide the required filter functions yet.

Thank you

Phil Harvey

Very nice.

In your bash script, isn't the first "if" statement unnecessary?  The bash -nt operator returns true if the second file doesn't exist, so won't the second "if" will take care of all these?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

mrbrahman

You're right! Saves me one step now.  :)

Any suggestions for a better design solution?

Thanks!

Phil Harvey

I didn't have much time to go through your scripts in detail, and that was the only thing I noticed on my quick look.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).