aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/tools')
-rw-r--r--mediagoblin/tools/exif.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/mediagoblin/tools/exif.py b/mediagoblin/tools/exif.py
index b8b4d9e6..b1da1833 100644
--- a/mediagoblin/tools/exif.py
+++ b/mediagoblin/tools/exif.py
@@ -73,16 +73,12 @@ def extract_exif(filename):
"""
Returns EXIF tags found in file at ``filename``
"""
- exif_tags = {}
-
try:
- image = open(filename)
- exif_tags = process_file(image, details=False)
+ with file(filename) as image:
+ return process_file(image, details=False)
except IOError:
raise BadMediaFail(_('Could not read the image file.'))
- return exif_tags
-
def clean_exif(exif):
'''