thumbnails/images.py
def create(source_name, size, metadata_backend=None, storage_backend=None):
    """
    Creates a thumbnail file and its relevant metadata. Returns a
    Thumbnail instance.
    """

    if storage_backend is None:
        storage_backend = backends.storage.get_backend()
    if metadata_backend is None:
        metadata_backend = backends.metadata.get_backend()

    thumbnail_file = processors.process(storage_backend.open(source_name), size)
    thumbnail_file = post_processors.process(thumbnail_file, size)
    name = get_thumbnail_name(source_name, size)
    name = storage_backend.save(name, thumbnail_file)

    metadata = metadata_backend.add_thumbnail(source_name, size, name)
    return Thumbnail(metadata=metadata, storage=storage_backend)
def create(source_name, size, metadata_backend=None, storage_backend=None):
    """
    Creates a thumbnail file and its relevant metadata. Returns a
    Thumbnail instance.
    """

    if storage_backend is None:
        storage_backend = backends.storage.get_backend()
    if metadata_backend is None:
        metadata_backend = backends.metadata.get_backend()

    thumbnail_file = processors.process(storage_backend.open(source_name), size)
    thumbnail_file = post_processors.process(thumbnail_file, size)
    name = get_thumbnail_name(source_name, size)
    name = storage_backend.save(name, thumbnail_file)

    metadata = metadata_backend.add_thumbnail(source_name, size, name)
    return Thumbnail(metadata=metadata, storage=storage_backend)
Creates a thumbnail file and its relevant metadata. Returns a
    Thumbnail instance.