Merge pull request #2722 from wiredfool/pr_2636

Updated version of #2636
This commit is contained in:
wiredfool 2017-09-09 13:42:44 +01:00 committed by GitHub
commit a795714a8f
4 changed files with 11 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]),
# adjust for image origin
"-f", infile, # input file
"-c", "showpage", # showpage (see: https://bugs.ghostscript.com/show_bug.cgi?id=698272)
]
if gs_windows_binary is not None:

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -71,6 +71,16 @@ class TestFileEps(PillowTestCase):
target = Image.open('Tests/images/pil_sample_rgb.jpg')
self.assert_image_similar(cmyk_image, target, 10)
def test_showpage(self):
# See https://github.com/python-pillow/Pillow/issues/2615
plot_image = Image.open("Tests/images/reqd_showpage.eps")
target = Image.open("Tests/images/reqd_showpage.png")
#should not crash/hang
plot_image.load()
# fonts could be slightly different
self.assert_image_similar(plot_image, target, 2)
def test_file_object(self):
# issue 479
image1 = Image.open(file1)