pexif
pexif copied to clipboard
`ifd_maker_note` may raise error if exif_file.make is not set yet
There is a possibility that MakerNote
section is in front of Make
section, which will raise an exception as follows:
AttributeError: ExifSegment instance has no attribute 'make'
Example photo links:
http://d3drsuq3xbnvq3.cloudfront.net/jp/pictures/201501/536906316/61e48289a1854983abba557ec1c6724c.jpeg
http://d3drsuq3xbnvq3.cloudfront.net/jp/pictures/201507/536906316/212a0c03410f5ed53c0ff8150216b10a.jpeg
A possible workaround is just skip this section.
def ifd_maker_note(e, offset, exif_file, mode, data):
try:
exif_file.make
except AttributeError:
msg = "Haven't got make yet. Skipping."
raise JpegFile.SkipTag(msg)
# ...
end
I confirm the above fix works
It would be cool if this could be put on pypi.
But it is cool anyway that the fix is here to apply manually :)
Is anyone addressing this? I can confirm that christophlingg's code in commit https://github.com/komoot/pexif/commit/b6f42517c82a2c1c47c691e429129e722029ca7b works
Thanks for the fix, would be great to have this fix released. Meanwhile we have to :monkey: patch