close file properly and remove unneeded variable
This commit is contained in:
parent
64376dc0bc
commit
9aff782ba7
@ -73,16 +73,12 @@ def extract_exif(filename):
|
|||||||
"""
|
"""
|
||||||
Returns EXIF tags found in file at ``filename``
|
Returns EXIF tags found in file at ``filename``
|
||||||
"""
|
"""
|
||||||
exif_tags = {}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
image = open(filename)
|
with file(filename) as image:
|
||||||
exif_tags = process_file(image, details=False)
|
return process_file(image, details=False)
|
||||||
except IOError:
|
except IOError:
|
||||||
raise BadMediaFail(_('Could not read the image file.'))
|
raise BadMediaFail(_('Could not read the image file.'))
|
||||||
|
|
||||||
return exif_tags
|
|
||||||
|
|
||||||
|
|
||||||
def clean_exif(exif):
|
def clean_exif(exif):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user