Stop reading from "res " after all information is extracted

This commit is contained in:
Andrew Murray 2021-08-01 18:39:35 +10:00
parent ae54838146
commit 3ee5a9b094

View File

@ -216,6 +216,7 @@ def _parse_jp2_header(fp):
vres = _res_to_dpi(vrcn, vrcd, vrce)
if hres is not None and vres is not None:
dpi = (hres, vres)
break
if size is None or mode is None:
raise SyntaxError("Malformed JP2 header")