Example #1
0
def generate_thumbnails(image_file_data, fs=None, image_type=None, filename=None, exclude_types=[]):
    """
    Specify an `image_type` to recreate just one image type.

    Returns a metadata object.
    """
    if fs is None:
        from canvas.upload import get_fs
        fs = get_fs(*settings.IMAGE_FS)

    thumbnailer = Thumbnailer(fs)
    return thumbnailer.store(image_file_data, image_type=image_type, filename=filename, exclude_types=exclude_types)
Example #2
0
def generate_thumbnails(image_file_data,
                        fs=None,
                        image_type=None,
                        filename=None,
                        exclude_types=[]):
    """
    Specify an `image_type` to recreate just one image type.

    Returns a metadata object.
    """
    if fs is None:
        from canvas.upload import get_fs
        fs = get_fs(*settings.IMAGE_FS)

    thumbnailer = Thumbnailer(fs)
    return thumbnailer.store(image_file_data,
                             image_type=image_type,
                             filename=filename,
                             exclude_types=exclude_types)
Example #3
0
 def handle(self, *args, **options):
     update_all_content(get_fs(*settings.IMAGE_FS), *args)
 def handle(self, *args, **options):
     update_all_content(get_fs(*settings.IMAGE_FS), *args)
 def handle(self, cid, *args, **options):
     update(get_fs(*settings.IMAGE_FS), Content.all_objects.get(id=cid), None)