def test_sanity(self): PillowQtTestCase.setUp(self) for mode in ('RGB', 'RGBA', 'L', 'P', '1'): src = hopper(mode) data = ImageQt.toqimage(src) self.assertIsInstance(data, QImage) self.assertFalse(data.isNull()) # reload directly from the qimage rt = ImageQt.fromqimage(data) if mode in ('L', 'P', '1'): self.assert_image_equal(rt, src.convert('RGB')) else: self.assert_image_equal(rt, src) if mode == '1': # BW appears to not save correctly on QT4 and QT5 # kicks out errors on console: # libpng warning: Invalid color type/bit depth combination in IHDR # libpng error: Invalid IHDR data continue # Test saving the file tempfile = self.tempfile('temp_{}.png'.format(mode)) data.save(tempfile) # Check that it actually worked. reloaded = Image.open(tempfile) # Gray images appear to come back in palette mode. # They're roughly equivalent if QT_VERSION == 4 and mode == 'L': src = src.convert('P') self.assert_image_equal(reloaded, src)
def test_segfault(self): PillowQtTestCase.setUp(self) app = QApplication([]) ex = Example() assert (app) # Silence warning assert (ex) # Silence warning
def test_segfault(self): PillowQtTestCase.setUp(self) app = QApplication([]) ex = Example() assert(app) # Silence warning assert(ex) # Silence warning
def test_sanity(self): PillowQtTestCase.setUp(self) for mode in ('1', 'RGB', 'RGBA', 'L', 'P'): data = ImageQt.toqimage(hopper(mode)) self.assertIsInstance(data, QImage) self.assertFalse(data.isNull()) # Test saving the file tempfile = self.tempfile('temp_{0}.png'.format(mode)) data.save(tempfile)
def test_sanity(self): PillowQtTestCase.setUp(self) for mode in ("1", "RGB", "RGBA", "L", "P"): data = ImageQt.toqpixmap(hopper(mode)) self.assertTrue(isinstance(data, QPixmap)) self.assertFalse(data.isNull()) # Test saving the file tempfile = self.tempfile("temp_{0}.png".format(mode)) data.save(tempfile)
def roundtrip(self, expected): PillowQtTestCase.setUp(self) result = ImageQt.fromqpixmap(ImageQt.toqpixmap(expected)) # Qt saves all pixmaps as rgb self.assert_image_equal(result, expected.convert('RGB'))
def test_segfault(self): PillowQtTestCase.setUp(self) app = QApplication([]) ex = Example()
def test_segfault(self): PillowQtTestCase.setUp(self) app = QtGui.QApplication([]) ex = Example()