ageitgey / image_to_numpy

Load an image file into a numpy array with Exif orientation support. Prevents upside-down and sideways images!
MIT License
180 stars 36 forks source link

Exception handled #1 #2

Open var-nan opened 3 years ago

var-nan commented 3 years ago

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.