def get_image_exif(image):
    """
    Gets an image's EXIF tags as a dict.
    """
    if not hasattr(image, '_getexif'):
        return {}

    metadata = image._getexif()
    if metadata is None:
        return {}

    return metadata