suggestion: implement batch reading
mattneub opened this issue · 4 comments
exiftool is much faster if you can read a batch of files at once, largely because of the overhead of firing up Perl along with exiftool's own environment for each file individually. exiftool itself supports this; in fact, you can just give a directory as its "file":
exiftool -DateTimeOriginal /path/to/directory/
I would like to suggest that mini_exiftool should support this. I have not thought about the syntax. :)
This feature is sometimes called "multi get". Note that Mceachen's exiftool wrapper gem permits this: https://github.com/mceachen/exiftool
Have a look at multi_exiftool. While mini_exiftool's focus is on one file at a time (especially atomar writing), multi_exiftool is specialised for handling multiple files at once. See the examples for more details.
A different gem - nice solution! Thank you very much; sorry I missed that. (By the way, I also want to thank you for the very helpful comments in the open source code of mini_exiftool
, which clarified some issues for me.)
Using multi_exiftool really solved my problem. Many thanks for writing it. And the redesigned code is truly elegant.
I've just uploaded a new version of multi_exiftool (0.3.0) with an additional new functional api. See https://github.com/janfri/multi_exiftool-redesign/blob/master/examples/05_functional_api.rb