Listing image file in directory and checking tags efficiently ?

Started by juju22, February 18, 2013, 04:30:45 PM

Previous topic - Next topic

juju22

Hello,

I'm doing some work in progress to solve my need of identifying/grouping pictures which could be used for panoramic [1].
I'm starting to review efficiency/performance/memory as in the end I will run it on a large collection.

For now, my initial listing is done like
for my $image (<$imageDir/*$ext>) {

I didnot find how to do the perl equivalent of
exiftool -p '$directory/$filename' -if "(\$keywords=~/pano/ and (\$exposurecompensation=~/0/ or \$exposurecompensation=~/-1\/3/ or \$exposurecompensation=~/-2\/3/))" -r -ext jpg -sort .
I checked here https://exiftool.org/ExifTool.html but perl module seems to depend on perl 'classical' tool to list dir. right ?

I also want to check if current tags include or exclude some others. any ideas how to do it fast ?
more precisely: I have 2 lists of keywords:
an include list => if one of this keyword is on picture, select it
an exclude list => if one, exclude picture/not select
list is like "tag1, tag2, tag3"
just reformat as matching regexp ? (m/(tag1|tag2|tag3)/i)

Thanks a lot.
Cheers,

Julien



[1] https://exiftool.org/forum/index.php/topic,4135.msg19586.html#msg19586

Phil Harvey

Yes, you must do the directory listing yourself as you mentioned.

I imagine that parsing the metadata of the file will dominate the processing overhead, so any way to you want to search the keywords is probably fine.  Your regex idea sounds good.

- 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 ($).