mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Merge pull request #6499 from radarhere/eps
This commit is contained in:
commit
96441fb3b1
BIN
Tests/images/1.eps
Normal file
BIN
Tests/images/1.eps
Normal file
Binary file not shown.
|
@ -146,6 +146,11 @@ def test_bytesio_object():
|
||||||
assert_image_similar(img, image1_scale1_compare, 5)
|
assert_image_similar(img, image1_scale1_compare, 5)
|
||||||
|
|
||||||
|
|
||||||
|
def test_1_mode():
|
||||||
|
with Image.open("Tests/images/1.eps") as im:
|
||||||
|
assert im.mode == "1"
|
||||||
|
|
||||||
|
|
||||||
def test_image_mode_not_supported(tmp_path):
|
def test_image_mode_not_supported(tmp_path):
|
||||||
im = hopper("RGBA")
|
im = hopper("RGBA")
|
||||||
tmpfile = str(tmp_path / "temp.eps")
|
tmpfile = str(tmp_path / "temp.eps")
|
||||||
|
|
|
@ -288,12 +288,15 @@ class EpsImageFile(ImageFile.ImageFile):
|
||||||
# Encoded bitmapped image.
|
# Encoded bitmapped image.
|
||||||
x, y, bi, mo = s[11:].split(None, 7)[:4]
|
x, y, bi, mo = s[11:].split(None, 7)[:4]
|
||||||
|
|
||||||
if int(bi) != 8:
|
if int(bi) == 1:
|
||||||
break
|
self.mode = "1"
|
||||||
|
elif int(bi) == 8:
|
||||||
try:
|
try:
|
||||||
self.mode = self.mode_map[int(mo)]
|
self.mode = self.mode_map[int(mo)]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
self._size = int(x), int(y)
|
self._size = int(x), int(y)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user