diff options
author | James R. Barlow <jim@purplerock.ca> | 2018-07-13 21:57:32 -0700 |
---|---|---|
committer | James R. Barlow <jim@purplerock.ca> | 2018-07-13 21:57:32 -0700 |
commit | f22db79cc3b1a1ab7645db64057bfa5220e80421 (patch) | |
tree | fd9bd059a7cbcf0602e5dc6195be2ed1bd2fe305 /tests/test_image_access.py | |
parent | 1846f16c53e2c68a7194da830b3fe5ab2003af17 (diff) |
Revise Object.write() to use kwargs
It's more natural in Python to omit a parameter than use an explicit
None, and this helps with normalizing the treatment of None's.
Diffstat (limited to 'tests/test_image_access.py')
-rw-r--r-- | tests/test_image_access.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_image_access.py b/tests/test_image_access.py index 73fe62b..acd85cb 100644 --- a/tests/test_image_access.py +++ b/tests/test_image_access.py @@ -51,8 +51,12 @@ def test_image_replace(congress, outdir): pillowimage = pdfimage.as_pil_image() grayscale = pillowimage.convert('L') + grayscale = grayscale.resize((4, 4)) # So it is not obnoxious on error - congress[0].write(zlib.compress(grayscale.tobytes()), Name("/FlateDecode"), Null()) + congress[0].write( + zlib.compress(grayscale.tobytes()), + filter=Name("/FlateDecode") + ) congress[0].ColorSpace = Name("/DeviceGray") pdf = congress[1] pdf.save(outdir / 'congress_gray.pdf') @@ -80,8 +84,12 @@ def test_lowlevel_replace_jpeg(congress, outdir): im = Image.open(BytesIO(raw_bytes)) grayscale = im.convert('L') + grayscale = grayscale.resize((4, 4)) # So it is not obnoxious on error - congress[0].write(zlib.compress(grayscale.tobytes()[:10]), Name("/FlateDecode"), Null()) + congress[0].write( + zlib.compress(grayscale.tobytes()[:10]), + filter=Name("/FlateDecode") + ) congress[0].ColorSpace = Name('/DeviceGray') pdf = congress[1] |