mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-29 18:23:24 +03:00
fix UnboundLocalError errors
This commit is contained in:
parent
c4baeccfce
commit
bb4eb53859
|
@ -205,10 +205,10 @@ class ImageFile(Image.Image):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise IndexError(ie)
|
raise IndexError(ie)
|
||||||
|
|
||||||
if not s: # truncated jpeg
|
if not s: # truncated jpeg
|
||||||
self.tile = []
|
self.tile = []
|
||||||
|
|
||||||
if LOAD_TRUNCATED_IMAGES:
|
if LOAD_TRUNCATED_IMAGES:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
@ -226,7 +226,7 @@ class ImageFile(Image.Image):
|
||||||
|
|
||||||
self.fp = None # might be shared
|
self.fp = None # might be shared
|
||||||
|
|
||||||
if (t == 0 or not LOAD_TRUNCATED_IMAGES) and not self.map and e < 0:
|
if (not LOAD_TRUNCATED_IMAGES or t == 0) and not self.map and e < 0:
|
||||||
# still raised if decoder fails to return anything
|
# still raised if decoder fails to return anything
|
||||||
raise_ioerror(e)
|
raise_ioerror(e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user