Utils module

ultimatethumb.utils.get_cache_key(key)[source]

Generates a prefixed cache-key for ultimatethumb.

ultimatethumb.utils.get_thumb_name(source, **options)[source]

Builds the thumbnail name and uses the name to store the source and options to cache.

ultimatethumb.utils.get_thumb_data(thumb_name)[source]

Uses the thumbail name and fetches the source and options from cache.

ultimatethumb.utils.parse_source(source)[source]

Parse and lookup the file system path for a given source. The function understands both media names and static names (if prefixed with “static:”)

ultimatethumb.utils.parse_sizes(value)[source]

Parses and returns a list of thumbnail sizes.

ultimatethumb.utils.factor_size(value, factor)[source]

Factors the given thumbnail size. Understands both absolute dimensions and percentages.

ultimatethumb.utils.get_size_for_path(path)[source]

Gets the image size for a given path. If the path does not exist, the call will fail loud with e.g. OSError exception.

ultimatethumb.utils.get_domain_url(url)[source]

Returns the given url prefixed with a domain if configured in settings.

ultimatethumb.utils.build_url(name, factor=1)[source]

Build the actual url for a given name and factor.

class ultimatethumb.utils.MoveableNamedTemporaryFile(name)[source]

Bases: object

chunks()[source]
close()[source]
temporary_file_path()[source]