def exif_aware_size(image):
    """
    Intelligently get an image size, flipping width and height if the Exif
    orientation tag includes a 90deg or 270deg rotation.

    :param image: A PIL Image.

    :returns: A 2-tuple (width, height).

    """
    # Extract the orientation tag
    orientation = get_exif_orientation(image)
    if orientation in ROTATION_TAGS:
        # Exif data indicates image should be rotated. Flip dimensions.
        return image.size[::-1]
    return image.size
dataset/ETHPy150Open littleweaver/django-daguerre/daguerre/utils.py/exif_aware_size/original