Justin Mayer 7f5e203e35 Improve Thumbnailer plugin ReadMe 8 vuotta sitten
..
test_data 5a133f1b28 Handle subdirectories in thumbnailer. 10 vuotta sitten
Readme.md 7f5e203e35 Improve Thumbnailer plugin ReadMe 8 vuotta sitten
__init__.py 9e2b0eb064 Implemented a thumbnailer that generates thumbnails in the output directory. 11 vuotta sitten
test_thumbnails.py ac55b5f434 add failing test 9 vuotta sitten
thumbnailer.py c780450f99 pass correct arguments to _resizer 9 vuotta sitten

Readme.md

Thumbnail Creation of images

This plugin creates thumbnails for all of the images found under a specific directory, in various thumbnail sizes. It requires PIL to function properly since PIL is used to resize the images, and the thumbnail will only be re-built if it doesn't already exist (to save processing time).

Installation

Set up like any other plugin, making sure to set PLUGIN_PATH and add thumbnailer to the PLUGINS list.

PIL or Pillow is required. If you choose Pillow, you need to install some additional external libraries to add support for image types like jpg.

Configuration

  • IMAGE_PATH is the path to the image directory. It should reside inside your content directory, and defaults to "pictures".
  • THUMBNAIL_DIR is the path to the output sub-directory where the thumbnails are generated.
  • THUMBNAIL_SIZES is a dictionary mapping size name to size specifications. The generated filename will be originalname_thumbnailname.ext unless THUMBNAIL_KEEP_NAME is set.
  • THUMBNAIL_KEEP_NAME is a Boolean that, if set, puts the file with the original name in a thumbnailname folder, named like the key in THUMBNAIL_SIZES.
  • THUMBNAIL_KEEP_TREE is a Boolean that, if set, saves the image directory tree.

Sizes can be specified using any of the following formats:

  • wxh will resize to exactly wxh cropping as necessary to get that size
  • wx? will resize so that the width is the specified size, and the height will scale to retain aspect ratio
  • ?xh same as wx? but will height being a set size
  • s is a shorthand for wxh where w=h