LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   querying exiftool keywords (flickr-like) (https://www.linuxquestions.org/questions/linux-software-2/querying-exiftool-keywords-flickr-like-598119/)

lrt 11-08-2007 01:33 PM

querying exiftool keywords (flickr-like)
 
i need to tag a bunch of image files for searching. i realize this can be done by editing the 'keywords' metadata tag. i found a great little program to help me do this called exiftool, http://owl.phy.queensu.ca/~phil/exiftool/

maybe someone knows how to use this program better than i do. i want exiftool to be able to list only the filenames containing a specified keyword.

exiftool has an '-if' option (see man page) to specify a condition but this doesn't really seem to work when it has to look through a list of keywords. but maybe it can and i just don't know how.

for example, this command does NOT return the file which contains the keyword shoe if this file has more than one keyword. the operator 'eq' doesn't really work for this.

exiftool -keywords -if '$keywords eq "shoe"' pictures/

so if i have a file with keywords 'shoe, pants, shirt' this command will not work because it will look for an exact match of the the string 'shoe'

any ideas on how to modify this???

(essentially i want to create something like flickr.com, but for private business purposes).

unSpawn 11-11-2007 07:26 AM

Here's an example with tag "exif:ImageDescription":
Code:

exiftool -exif:ImageDescription="a shoe"  /tmp/test.jpg
exiftool -exif:ImageDescription="not a shoe"  /tmp/test1.jpg
exiftool -exif:ImageDescription="shoo cat"  /tmp/test2.jpg

exiftool -FileName -if '$ImageDescription =~ "a shoe"' /tmp/test*.jpg | grep ^F
File Name                      : test1.jpg
File Name                      : test.jpg


lrt 11-12-2007 10:06 AM

exactly what i needed, thanks.


All times are GMT -5. The time now is 06:36 PM.