algoo / preview-generator

generates previews of files with cache management
https://pypi.org/project/preview-generator/
MIT License
235 stars 51 forks source link

Feat:batch script support #267

Open emyoulation opened 3 years ago

emyoulation commented 3 years ago

Feature description and goals

There appears to be Command Line support for single Preview thumbnails to cache. It would useful to populate a destination folder with thumbnails of specific size.

This would need batch script processor with parameters for source file, destinations file, thumbnail dimension(s) and page offset selection (for multi-page documentation like PDFs) or subregion designation (for over-sized images with significant dead-space that would render poorly as thumbnails).

Example use case: The open-source Python 3.5 genealogy database application Gramps supports attachment of Media files with thumbnails. But the internal thumbnail generator does not support nearly the variety of MIME types. And the the project distributes under the GNU General Public License, version 2 (GPLv2). Rather than deal with the hassle of multiple licensing, it would be simpler to recommend running preview-generator as a separately installed utility and have Gramps generate a report that outputs a batch script.

References: https://github.com/gramps-project/gramps

raphj commented 3 years ago

Hello @emyoulation,

Do you have an example of something that would not work by simply calling preview-generator in a bash loop to perform a batch operation?

Can you give an example of command line you'd would like to be able to run?