Do not raise SyntaxError for wrong chunks (just ignore them)

This commit is contained in:
Alexander 2017-05-22 19:38:38 +03:00
parent 38eff74004
commit a26a584812

View File

@ -113,7 +113,8 @@ class ChunkStream(object):
length = i32(s)
if not is_cid(cid):
raise SyntaxError("broken PNG file (chunk %s)" % repr(cid))
if not ImageFile.LOAD_TRUNCATED_IMAGES:
raise SyntaxError("broken PNG file (chunk %s)" % repr(cid))
return cid, pos, length