Skip to content

Commit

Permalink
Discard other types of segments that are not Exif (like XMP)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfinnberg authored Oct 11, 2018
1 parent dc5b3c8 commit 73c49ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions piexif/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def read_exif_from_file(filename):

if head[:2] == b"\xff\xe1":
segment_data = f.read(length - 2)
if segment_data[0:4] != b'Exif':
break
exif = head + segment_data
break
elif head[0:1] == b"\xff":
Expand Down

0 comments on commit 73c49ae

Please sign in to comment.