Skip to content

Commit

Permalink
convert eps using pnmraw instead of ppmraw
Browse files Browse the repository at this point in the history
This lets Ghostscript choose the best device to use (pbmraw, pgmraw, ppmraw) based on the image data.
  • Loading branch information
Yay295 committed Aug 3, 2024
1 parent 5f6055a commit 1a4a571
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tests/test_file_eps.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_load_long_binary_data(prefix: bytes) -> None:
data = io.BytesIO(prefix + b"\n".join(simple_eps_file_with_long_binary_data))
with Image.open(data) as img:
img.load()
assert img.mode == "RGB"
assert img.mode == "1"
assert img.size == (100, 100)
assert img.format == "EPS"

Expand Down
2 changes: 1 addition & 1 deletion src/PIL/EpsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def Ghostscript(
lengthfile -= len(s)
f.write(s)

device = "pngalpha" if transparency else "ppmraw"
device = "pngalpha" if transparency else "pnmraw"

# Build Ghostscript command
command = [
Expand Down

0 comments on commit 1a4a571

Please sign in to comment.