Skip to content

Instantly share code, notes, and snippets.

View verarong's full-sized avatar

芮钧 verarong

  • 南京
View GitHub Profile
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
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: