本文整理汇总了Python中daguerre.adjustments.Fill类的典型用法代码示例。如果您正苦于以下问题:Python Fill类的具体用法?Python Fill怎么用?Python Fill使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Fill类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_adjust__unequal
def test_adjust__unequal(self):
im = Image.open(self._data_path('100x100.png'))
fill = Fill(width=50, height=40)
adjusted = fill.adjust(im)
self.assertEqual(adjusted.size, (50, 40))
expected = Image.open(self._data_path('50x40_fill.png'))
self.assertImageEqual(adjusted, expected)
示例2: test_adjust__max_width__smaller
def test_adjust__max_width__smaller(self):
im = Image.open(self._data_path('100x100.png'))
fill = Fill(height=100, max_width=50)
adjusted = fill.adjust(im)
self.assertEqual(adjusted.size, (50, 100))
expected = Image.open(self._data_path('50x100_crop.png'))
self.assertImageEqual(adjusted, expected)
示例3: test_adjust__max_width
def test_adjust__max_width(self):
im = Image.open(self._data_path('100x100.png'))
fill = Fill(height=50, max_width=200)
adjusted = fill.adjust(im)
self.assertEqual(adjusted.size, (50, 50))
expected = Image.open(self._data_path('50x50_fit.png'))
self.assertImageEqual(adjusted, expected)
示例4: test_calculate__strings
def test_calculate__strings(self):
fill = Fill(height='100', max_width='50')
self.assertEqual(fill.calculate((100, 100)), (50, 100))
示例5: test_calculate__max_width__smaller
def test_calculate__max_width__smaller(self):
fill = Fill(height=100, max_width=50)
self.assertEqual(fill.calculate((100, 100)), (50, 100))
示例6: test_calculate__max_width
def test_calculate__max_width(self):
fill = Fill(height=50, max_width=200)
self.assertEqual(fill.calculate((100, 100)), (50, 50))
示例7: test_calculate__height
def test_calculate__height(self):
fill = Fill(height=50)
self.assertEqual(fill.calculate((100, 100)), (50, 50))
示例8: test_calculate__width
def test_calculate__width(self):
fill = Fill(width=50)
self.assertEqual(fill.calculate((100, 100)), (50, 50))
示例9: test_calculate__unequal
def test_calculate__unequal(self):
fill = Fill(width=50, height=40)
self.assertEqual(fill.calculate((100, 100)), (50, 40))