def get_image(source, exif_orientation=True, **options):
    # Use a StringIO wrapper because if the source is an incomplete file like
    # object, PIL may have problems with it. For example, some image types
    # require tell and seek methods that are not present on all storage
    # File objects.

    source = StringIO(source.read())

    image = Image.open(source)
    # Fully load the image now to catch any problems with the image
    # contents.
    image.load()

    if exif_orientation:
        image = _exif_orientation(image)
    return image
Decorator that accepts a list of permission names, and allows the user
dataset/ETHPy150Open hcarvalhoalves/django-rest-thumbnails/restthumbnails/processors.py/get_image--crossover with--dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailadmin/utils.py/any_permission_required