Fix EPS import

Fixes EPS import by adding the missing "showpage" Postscript command
to the end of the gs call.

See: https://bugs.ghostscript.com/show_bug.cgi?id=698272

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
This commit is contained in:
Samuele Kaplun 2017-07-19 21:54:16 +02:00 committed by Eric Soroos
parent 5238e7ccc8
commit c07ce878d7
3 changed files with 5 additions and 0 deletions

View File

@ -129,6 +129,7 @@ def Ghostscript(tile, size, fp, scale=1):
"-c", "%d %d translate" % (-bbox[0], -bbox[1]), "-c", "%d %d translate" % (-bbox[0], -bbox[1]),
# adjust for image origin # adjust for image origin
"-f", infile, # input file "-f", infile, # input file
"-c", "showpage", # showpage (see: https://bugs.ghostscript.com/show_bug.cgi?id=698272)
] ]
if gs_windows_binary is not None: if gs_windows_binary is not None:

BIN
Tests/images/d15-120f10.eps Normal file

Binary file not shown.

View File

@ -71,6 +71,10 @@ class TestFileEps(PillowTestCase):
target = Image.open('Tests/images/pil_sample_rgb.jpg') target = Image.open('Tests/images/pil_sample_rgb.jpg')
self.assert_image_similar(cmyk_image, target, 10) self.assert_image_similar(cmyk_image, target, 10)
def test_showpage(self):
plot_image = Image.open("Tests/images/d15-120f10.eps")
plot_image.load()
def test_file_object(self): def test_file_object(self):
# issue 479 # issue 479
image1 = Image.open(file1) image1 = Image.open(file1)