Skip to content

Commit 1a4a571

Browse files
committed
convert eps using pnmraw instead of ppmraw
This lets Ghostscript choose the best device to use (pbmraw, pgmraw, ppmraw) based on the image data.
1 parent 5f6055a commit 1a4a571

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Tests/test_file_eps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_load_long_binary_data(prefix: bytes) -> None:
180180
data = io.BytesIO(prefix + b"\n".join(simple_eps_file_with_long_binary_data))
181181
with Image.open(data) as img:
182182
img.load()
183-
assert img.mode == "RGB"
183+
assert img.mode == "1"
184184
assert img.size == (100, 100)
185185
assert img.format == "EPS"
186186

src/PIL/EpsImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def Ghostscript(
121121
lengthfile -= len(s)
122122
f.write(s)
123123

124-
device = "pngalpha" if transparency else "ppmraw"
124+
device = "pngalpha" if transparency else "pnmraw"
125125

126126
# Build Ghostscript command
127127
command = [

0 commit comments

Comments
 (0)