def create(source_name, size, metadata_backend=None, storage_backend=None):
if storage_backend is None:<EOL><INDENT>storage_backend = backends.storage.get_backend()<EOL><DEDENT>if metadata_backend is None:<EOL><INDENT>metadata_backend = backends.metadata.get_backend()<EOL><DEDENT>thumbnail_file = processors.process(storage_backend.open(source_name), size)<EOL>thumbnail_file = post_processors.process(thumbnail_file, size)<EOL>name = get_thumbnail_name(source_name, size)<EOL>name = storage_backend.save(name, thumbnail_file)<EOL>metadata = metadata_backend.add_thumbnail(source_name, size, name)<EOL>return Thumbnail(metadata=metadata, storage=storage_backend)<EOL>
Creates a thumbnail file and its relevant metadata. Returns a
Thumbnail instance.