Exemplo n.º 1
0
    def test_resize_image_expand(self):
        qimage = QImage(32, 64, QImage.Format.Format_RGB32)
        qimage.fill(QColor(0x44, 0x88, 0xcc))

        qimage = resize_image(qimage, (128, 128), AspectRatio.keep_expand)

        self.assertIsInstance(qimage, QImage)
        self.assertEqual(qimage.width(), 128)
        self.assertEqual(qimage.height(), 256)
Exemplo n.º 2
0
    def test_resize_image_smooth(self):
        qimage = QImage(32, 64, QImage.Format.Format_RGB32)
        qimage.fill(QColor(0x44, 0x88, 0xcc))

        qimage = resize_image(qimage, (128, 128), mode=ScaleMode.smooth)

        self.assertIsInstance(qimage, QImage)
        self.assertEqual(qimage.width(), 128)
        self.assertEqual(qimage.height(), 128)