def get_exif_data(filename):
logger = logging.getLogger(__name__)<EOL>img = _read_image(filename)<EOL>try:<EOL><INDENT>exif = img._getexif() or {}<EOL><DEDENT>except ZeroDivisionError:<EOL><INDENT>logger.warning('<STR_LIT>')<EOL>return None<EOL><DEDENT>data = {TAGS.get(tag, tag): value for tag, value in exif.items()}<EOL>if '<STR_LIT>' in data:<EOL><INDENT>try:<EOL><INDENT>data['<STR_LIT>'] = {GPSTAGS.get(tag, tag): value<EOL>for tag, value in data['<STR_LIT>'].items()}<EOL><DEDENT>except AttributeError:<EOL><INDENT>logger = logging.getLogger(__name__)<EOL>logger.info('<STR_LIT>')<EOL>del data['<STR_LIT>']<EOL><DEDENT><DEDENT>return data<EOL>
Return a dict with the raw EXIF data.