[KPhotoAlbum] Command line filtering
rlk at alum.mit.edu
Sun Feb 17 01:17:08 CET 2019
For a project I might or might not do, I was thinking of writing a
script to list the images in an index.xml file, with optional
filtering on the command line or via a file.
The filter "syntax" would actually be a perl expression. This sounds
inefficient, but it can be done via creating the loop as a string with
the filter expression embedded, and then eval'ing the entire loop.
One-off tags like filename, start/end date, height, width etc. would
be expressed as simple variables; an invocation might look like
kpa-filter index.xml '($height * $width > 20000000) && (has_keyword("foo") || matches_person("krawitz") || matches_category("Places", "USA"))'
or put the expression in a file and use it via -f. The output would
be a list of filenames.
Do people think this would be interesting? I should warn everyone
that the next month will be very busy for me (I'm hoping it will be,
at any rate) depending upon how deep we go in the NCAA Division III
Robert Krawitz <rlk at alum.mit.edu>
*** MIT Engineers A Proud Tradition http://mitathletics.com ***
Member of the League for Programming Freedom -- http://ProgFree.org
Project lead for Gutenprint -- http://gimp-print.sourceforge.net
"Linux doesn't dictate how I work, I dictate how Linux works."
More information about the KPhotoAlbum