This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from FlaskApp.FlaskApp import app, db, tools, schema | |
except: | |
import sys | |
sys.path.append('..') | |
from FlaskApp import app, db, schema | |
from FlaskApp.Mongo_Model import configs | |
from FlaskApp.utils import _sum_dict, debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img_pil = Image.open(img_path) | |
try: | |
if hasattr(img_pil, '_getexif'): | |
# from PIL import ExifTags | |
# for orientation in ExifTags.TAGS.keys(): | |
# if ExifTags.TAGS[orientation] == 'Orientation': | |
# break | |
orientation = 274 | |
exif = dict(img_pil._getexif().items()) | |
if exif[orientation] == 3: |