def _open(self): data, width, height, self.mode, icc_profile, exif = _webp.WebPDecode(self.fp.read()) self.info["icc_profile"] = icc_profile self.info["exif"] = exif self.size = width, height self.fp = BytesIO(data) self.tile = [("raw", (0, 0) + self.size, 0, self.mode)]
def test_WebPDecode_with_invalid_args(self): """ Calling decoder functions with no arguments should result in an error. """ if _webp.HAVE_WEBPANIM: with pytest.raises(TypeError): _webp.WebPAnimDecoder() with pytest.raises(TypeError): _webp.WebPDecode()
def _open(self): data, width, height, self.mode = _webp.WebPDecode(self.fp.read()) self.size = width, height self.fp = BytesIO(data) self.tile = [("raw", (0, 0) + self.size, 0, self.mode)]