ExifTool Forum

General => Other Discussion => Topic started by: mrbrahman on May 24, 2018, 02:03:32 PM

Title: Designing metadata storage
Post by: mrbrahman on May 24, 2018, 02:03:32 PM
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
Title: Re: Designing metadata storage
Post by: Phil Harvey on May 25, 2018, 07:13:25 AM
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
Title: Re: Designing metadata storage
Post by: mrbrahman on May 26, 2018, 09:13:06 AM
You're right! Saves me one step now.  :)

Any suggestions for a better design solution?

Thanks!
Title: Re: Designing metadata storage
Post by: Phil Harvey on May 26, 2018, 09:05:03 PM
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