PIL.ImageOps.exif_transpose() is raising exception. it is mentioned in #1 . Until it is fixed, the user-defined function is used in exception block.
PIL.ImageOps.exif_transpose() in try block is erasing the orientation parameter of the image internally before raising exception. So a new instance of the image is created in the exception block to get the orientation parameter and transpose is performed with the user-defined function.
PIL.ImageOps.exif_transpose() is raising exception. it is mentioned in #1 . Until it is fixed, the user-defined function is used in exception block.
PIL.ImageOps.exif_transpose()
intry
block is erasing the orientation parameter of the image internally before raising exception. So a new instance of the image is created in theexception
block to get the orientation parameter and transpose is performed with the user-defined function.