Namers

easy-thumbnails allows you to customize how thumbnail filenames are generated by setting THUMBNAIL_NAMER to the dotted path of a namer function.

Custom namers receive thumbnailer, source_filename, thumbnail_extension, thumbnail_options, and prepared_options keyword arguments and must return a filename.

Built-in namers

easy_thumbnails.namers.alias(thumbnailer, thumbnail_options, source_filename, thumbnail_extension, **kwargs)

Generate filename based on thumbnail alias name (option THUMBNAIL_ALIASES).

For example: source.jpg.medium_large.jpg

easy_thumbnails.namers.default(thumbnailer, prepared_options, source_filename, thumbnail_extension, **kwargs)

Easy-thumbnails’ default name processor.

For example: source.jpg.100x100_q80_crop_upscale.jpg

easy_thumbnails.namers.hashed(source_filename, prepared_options, thumbnail_extension, **kwargs)

Generate a short hashed thumbnail filename.

Creates a 12 character url-safe base64 sha1 filename (plus the extension), for example: 6qW1buHgLaZ9.jpg.

easy_thumbnails.namers.source_hashed(source_filename, prepared_options, thumbnail_extension, **kwargs)

Generate a thumbnail filename of the source filename and options separately hashed, along with the size.

The format of the filename is a 12 character base64 sha1 hash of the source filename, the size surrounded by underscores, and an 8 character options base64 sha1 hash of the thumbnail options. For example: 1xedFtqllFo9_100x100_QHCa6G1l.jpg.