aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/exif.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/tools/exif.py')
-rw-r--r--mediagoblin/tools/exif.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mediagoblin/tools/exif.py b/mediagoblin/tools/exif.py
index de6dd128..448a342e 100644
--- a/mediagoblin/tools/exif.py
+++ b/mediagoblin/tools/exif.py
@@ -32,6 +32,13 @@ USEFUL_TAGS = [
'EXIF UserComment',
]
+def exif_image_needs_rotation(exif_tags):
+ """
+ Returns True if EXIF orientation requires rotation
+ """
+ return 'Image Orientation' in exif_tags \
+ and exif_tags['Image Orientation'].values[0] != 1
+
def exif_fix_image_orientation(im, exif_tags):
"""
Translate any EXIF orientation to raw orientation