mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-14 03:21:44 +03:00
Don't search for the imagedata if we're not going to do anything with it
This commit is contained in:
parent
9b35a4538d
commit
8f75cc2bbf
|
@ -308,7 +308,7 @@ class EpsImageFile(ImageFile.ImageFile):
|
||||||
s = s[:-1]
|
s = s[:-1]
|
||||||
|
|
||||||
if s[:11] == "%ImageData:":
|
if s[:11] == "%ImageData:":
|
||||||
|
# Encoded bitmapped image.
|
||||||
[x, y, bi, mo, z3, z4, en, id] =\
|
[x, y, bi, mo, z3, z4, en, id] =\
|
||||||
s[11:].split(None, 7)
|
s[11:].split(None, 7)
|
||||||
|
|
||||||
|
@ -336,20 +336,7 @@ class EpsImageFile(ImageFile.ImageFile):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
if id[:1] == id[-1:] == '"':
|
self.size = (x,y)
|
||||||
id = id[1:-1]
|
|
||||||
|
|
||||||
# Scan forward to the actual image data
|
|
||||||
while True:
|
|
||||||
s = fp.readline()
|
|
||||||
if not s:
|
|
||||||
break
|
|
||||||
if s[:len(id)] == id:
|
|
||||||
self.size = x, y
|
|
||||||
self.tile2 = [(decoder,
|
|
||||||
(0, 0, x, y),
|
|
||||||
fp.tell(),
|
|
||||||
0)]
|
|
||||||
return
|
return
|
||||||
|
|
||||||
s = fp.readline()
|
s = fp.readline()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user