mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
Fix tostring()/tobytes() warning and reinstate test
This commit is contained in:
parent
bcb8534dcf
commit
c37aa0a9ca
|
@ -144,7 +144,7 @@ def _save(im, fp, filename):
|
||||||
if bits == 1:
|
if bits == 1:
|
||||||
# FIXME: the hex encoder doesn't support packed 1-bit
|
# FIXME: the hex encoder doesn't support packed 1-bit
|
||||||
# images; do things the hard way...
|
# images; do things the hard way...
|
||||||
data = im.tostring("raw", "1")
|
data = im.tobytes("raw", "1")
|
||||||
im = Image.new("L", (len(data), 1), None)
|
im = Image.new("L", (len(data), 1), None)
|
||||||
im.putdata(data)
|
im.putdata(data)
|
||||||
ImageFile._save(im, op, [("hex", (0,0)+im.size, 0, im.mode)])
|
ImageFile._save(im, op, [("hex", (0,0)+im.size, 0, im.mode)])
|
||||||
|
|
|
@ -15,18 +15,12 @@ def helper_save_as_pdf(mode):
|
||||||
assert_greater(os.path.getsize(outfile), 0)
|
assert_greater(os.path.getsize(outfile), 0)
|
||||||
|
|
||||||
|
|
||||||
# FIXME: 1-mode test "fails" because it produces a warning.
|
def test_monochrome():
|
||||||
# https://travis-ci.org/hugovk/Pillow/builds/24916085
|
# Arrange
|
||||||
# /home/travis/build/hugovk/Pillow/PIL/PdfImagePlugin.py:147:
|
mode = "1"
|
||||||
# DeprecationWarning: tostring() is deprecated. Please call tobytes() instead.
|
|
||||||
# data = im.tostring("raw", "1")
|
# Act / Assert
|
||||||
#
|
helper_save_as_pdf(mode)
|
||||||
# def test_monochrome():
|
|
||||||
# # Arrange
|
|
||||||
# mode = "1"
|
|
||||||
#
|
|
||||||
# # Act / Assert
|
|
||||||
# helper_save_as_pdf(mode)
|
|
||||||
|
|
||||||
|
|
||||||
def test_greyscale():
|
def test_greyscale():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user