In get_orientation is line:
orientation = exif['Orientation']['num']
If orientation missing in exif, it get error and function get_orientation not returning landscape/portrait value.
The code should be something like this:
try:
orientation = exif['Orientation']['num']
except:
orientation = 0
In get_orientation is line:
orientation = exif['Orientation']['num']If orientation missing in exif, it get error and function get_orientation not returning landscape/portrait value.
The code should be something like this: