mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-29 10:13:09 +03:00
Continuation line under-indented for visual indent
This commit is contained in:
parent
6dd0e48d9a
commit
9b0d4baa8c
|
@ -335,35 +335,35 @@ class TestColorLut3DFilter(PillowTestCase):
|
||||||
g.transpose(Image.ROTATE_180)])
|
g.transpose(Image.ROTATE_180)])
|
||||||
|
|
||||||
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
||||||
lambda r, g, b: (r, g, b))
|
lambda r, g, b: (r, g, b))
|
||||||
lut.table = numpy.array(lut.table, dtype=numpy.float32)[:-1]
|
lut.table = numpy.array(lut.table, dtype=numpy.float32)[:-1]
|
||||||
with self.assertRaisesRegex(ValueError, "should have table_channels"):
|
with self.assertRaisesRegex(ValueError, "should have table_channels"):
|
||||||
im.filter(lut)
|
im.filter(lut)
|
||||||
|
|
||||||
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
||||||
lambda r, g, b: (r, g, b))
|
lambda r, g, b: (r, g, b))
|
||||||
lut.table = (numpy.array(lut.table, dtype=numpy.float32)
|
lut.table = (numpy.array(lut.table, dtype=numpy.float32)
|
||||||
.reshape((7 * 9 * 11), 3))
|
.reshape((7 * 9 * 11), 3))
|
||||||
with self.assertRaisesRegex(ValueError, "should have table_channels"):
|
with self.assertRaisesRegex(ValueError, "should have table_channels"):
|
||||||
im.filter(lut)
|
im.filter(lut)
|
||||||
|
|
||||||
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
||||||
lambda r, g, b: (r, g, b))
|
lambda r, g, b: (r, g, b))
|
||||||
lut.table = numpy.array(lut.table, dtype=numpy.float16)
|
lut.table = numpy.array(lut.table, dtype=numpy.float16)
|
||||||
self.assert_image_equal(im, im.filter(lut))
|
self.assert_image_equal(im, im.filter(lut))
|
||||||
|
|
||||||
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
||||||
lambda r, g, b: (r, g, b))
|
lambda r, g, b: (r, g, b))
|
||||||
lut.table = numpy.array(lut.table, dtype=numpy.float32)
|
lut.table = numpy.array(lut.table, dtype=numpy.float32)
|
||||||
self.assert_image_equal(im, im.filter(lut))
|
self.assert_image_equal(im, im.filter(lut))
|
||||||
|
|
||||||
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
||||||
lambda r, g, b: (r, g, b))
|
lambda r, g, b: (r, g, b))
|
||||||
lut.table = numpy.array(lut.table, dtype=numpy.float64)
|
lut.table = numpy.array(lut.table, dtype=numpy.float64)
|
||||||
self.assert_image_equal(im, im.filter(lut))
|
self.assert_image_equal(im, im.filter(lut))
|
||||||
|
|
||||||
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
lut = ImageFilter.Color3DLUT.generate((7, 9, 11),
|
||||||
lambda r, g, b: (r, g, b))
|
lambda r, g, b: (r, g, b))
|
||||||
lut.table = numpy.array(lut.table, dtype=numpy.int32)
|
lut.table = numpy.array(lut.table, dtype=numpy.int32)
|
||||||
im.filter(lut)
|
im.filter(lut)
|
||||||
lut.table = numpy.array(lut.table, dtype=numpy.int8)
|
lut.table = numpy.array(lut.table, dtype=numpy.int8)
|
||||||
|
|
|
@ -175,11 +175,11 @@ class TestImageCms(PillowTestCase):
|
||||||
|
|
||||||
def test_unsupported_color_space(self):
|
def test_unsupported_color_space(self):
|
||||||
self.assertRaises(ImageCms.PyCMSError,
|
self.assertRaises(ImageCms.PyCMSError,
|
||||||
ImageCms.createProfile, "unsupported")
|
ImageCms.createProfile, "unsupported")
|
||||||
|
|
||||||
def test_invalid_color_temperature(self):
|
def test_invalid_color_temperature(self):
|
||||||
self.assertRaises(ImageCms.PyCMSError,
|
self.assertRaises(ImageCms.PyCMSError,
|
||||||
ImageCms.createProfile, "LAB", "invalid")
|
ImageCms.createProfile, "LAB", "invalid")
|
||||||
|
|
||||||
def test_simple_lab(self):
|
def test_simple_lab(self):
|
||||||
i = Image.new('RGB', (10, 10), (128, 128, 128))
|
i = Image.new('RGB', (10, 10), (128, 128, 128))
|
||||||
|
@ -446,20 +446,20 @@ class TestImageCms(PillowTestCase):
|
||||||
self.assert_image_equal(source_image_aux, result_image_aux)
|
self.assert_image_equal(source_image_aux, result_image_aux)
|
||||||
|
|
||||||
def test_preserve_auxiliary_channels_rgba(self):
|
def test_preserve_auxiliary_channels_rgba(self):
|
||||||
self.assert_aux_channel_preserved(mode='RGBA',
|
self.assert_aux_channel_preserved(
|
||||||
transform_in_place=False, preserved_channel='A')
|
mode='RGBA', transform_in_place=False, preserved_channel='A')
|
||||||
|
|
||||||
def test_preserve_auxiliary_channels_rgba_in_place(self):
|
def test_preserve_auxiliary_channels_rgba_in_place(self):
|
||||||
self.assert_aux_channel_preserved(mode='RGBA',
|
self.assert_aux_channel_preserved(
|
||||||
transform_in_place=True, preserved_channel='A')
|
mode='RGBA', transform_in_place=True, preserved_channel='A')
|
||||||
|
|
||||||
def test_preserve_auxiliary_channels_rgbx(self):
|
def test_preserve_auxiliary_channels_rgbx(self):
|
||||||
self.assert_aux_channel_preserved(mode='RGBX',
|
self.assert_aux_channel_preserved(
|
||||||
transform_in_place=False, preserved_channel='X')
|
mode='RGBX', transform_in_place=False, preserved_channel='X')
|
||||||
|
|
||||||
def test_preserve_auxiliary_channels_rgbx_in_place(self):
|
def test_preserve_auxiliary_channels_rgbx_in_place(self):
|
||||||
self.assert_aux_channel_preserved(mode='RGBX',
|
self.assert_aux_channel_preserved(
|
||||||
transform_in_place=True, preserved_channel='X')
|
mode='RGBX', transform_in_place=True, preserved_channel='X')
|
||||||
|
|
||||||
def test_auxiliary_channels_isolated(self):
|
def test_auxiliary_channels_isolated(self):
|
||||||
# test data in aux channels does not affect non-aux channels
|
# test data in aux channels does not affect non-aux channels
|
||||||
|
|
|
@ -450,12 +450,12 @@ class PdfParser:
|
||||||
self.pages_ref = self.next_object_id(0)
|
self.pages_ref = self.next_object_id(0)
|
||||||
self.rewrite_pages()
|
self.rewrite_pages()
|
||||||
self.write_obj(self.root_ref,
|
self.write_obj(self.root_ref,
|
||||||
Type=PdfName(b"Catalog"),
|
Type=PdfName(b"Catalog"),
|
||||||
Pages=self.pages_ref)
|
Pages=self.pages_ref)
|
||||||
self.write_obj(self.pages_ref,
|
self.write_obj(self.pages_ref,
|
||||||
Type=PdfName(b"Pages"),
|
Type=PdfName(b"Pages"),
|
||||||
Count=len(self.pages),
|
Count=len(self.pages),
|
||||||
Kids=self.pages)
|
Kids=self.pages)
|
||||||
return self.root_ref
|
return self.root_ref
|
||||||
|
|
||||||
def rewrite_pages(self):
|
def rewrite_pages(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user