diff --git a/Tests/test_file_eps.py b/Tests/test_file_eps.py index f9e1702ef..e9d051b11 100644 --- a/Tests/test_file_eps.py +++ b/Tests/test_file_eps.py @@ -2,6 +2,7 @@ from tester import * from PIL import Image, EpsImagePlugin import sys +import io if EpsImagePlugin.gs_windows_binary == False: # already checked. Not there. @@ -54,6 +55,18 @@ def test_sanity(): assert_equal(image2_scale2.size, (720, 504)) assert_equal(image2_scale2.format, "EPS") +def test_file_object(): + #issue 479 + image1 = Image.open(file1) + with open(tempfile('temp_file.eps'), 'wb') as fh: + image1.save(fh, 'EPS') + +def test_iobase_object(): + #issue 479 + image1 = Image.open(file1) + with io.open(tempfile('temp_iobase.eps'), 'wb') as fh: + image1.save(fh, 'EPS') + def test_render_scale1(): #We need png support for these render test codecs = dir(Image.core) @@ -93,4 +106,3 @@ def test_render_scale2(): image2_scale2_compare = Image.open(file2_compare_scale2).convert("RGB") image2_scale2_compare.load() assert_image_similar(image2_scale2, image2_scale2_compare, 10) -