Skip to content

Commit 8f75cc2

Browse files
committed
Don't search for the imagedata if we're not going to do anything with it
1 parent 9b35a45 commit 8f75cc2

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

PIL/EpsImagePlugin.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def _open(self):
308308
s = s[:-1]
309309

310310
if s[:11] == "%ImageData:":
311-
311+
# Encoded bitmapped image.
312312
[x, y, bi, mo, z3, z4, en, id] =\
313313
s[11:].split(None, 7)
314314

@@ -335,23 +335,10 @@ def _open(self):
335335
self.mode = "RGB"
336336
else:
337337
break
338-
339-
if id[:1] == id[-1:] == '"':
340-
id = id[1:-1]
341-
342-
# Scan forward to the actual image data
343-
while True:
344-
s = fp.readline()
345-
if not s:
346-
break
347-
if s[:len(id)] == id:
348-
self.size = x, y
349-
self.tile2 = [(decoder,
350-
(0, 0, x, y),
351-
fp.tell(),
352-
0)]
353-
return
354-
338+
339+
self.size = (x,y)
340+
return
341+
355342
s = fp.readline()
356343
if not s:
357344
break

0 commit comments

Comments
 (0)