Skip to content
Browse files
don't pop the dict while iterating it
  • Loading branch information
ralsina committed Jul 18, 2016
1 parent 5c9d11e commit c53ad18194af597428527a600e494a67bff68356
Showing 1 changed file with 3 additions and 3 deletions.
@@ -79,17 +79,17 @@ def filter_exif(self, exif, whitelist):
return {}

# Scenario 3: keep some
for k in exif:
for k in list(exif.keys()):
if type(exif[k]) != dict:
pass # At least thumbnails have no fields
if k not in whitelist:
elif k not in whitelist:
exif.pop(k) # Not whitelisted, remove
elif k in whitelist and whitelist[k] == '*':
# Fully whitelisted, keep all
# Partially whitelisted
for tag in exif[k]:
for tag in list(exif[k].keys()):
if EXIF_TAG_NAMES[tag] not in whitelist[k]:

0 comments on commit c53ad18

Please sign in to comment.