diff --git a/Tests/test_file_qoi.py b/Tests/test_file_qoi.py index f33eada61..0a835dcf6 100644 --- a/Tests/test_file_qoi.py +++ b/Tests/test_file_qoi.py @@ -2,7 +2,7 @@ import pytest from PIL import Image, QoiImagePlugin -from .helper import assert_image_equal_tofile, assert_image_similar_tofile +from .helper import assert_image_equal_tofile def test_sanity(): @@ -18,7 +18,7 @@ def test_sanity(): assert im.size == (162, 150) assert im.format == "QOI" - assert_image_similar_tofile(im, "Tests/images/pil123rgba.png", 0.03) + assert_image_equal_tofile(im, "Tests/images/pil123rgba.png") def test_invalid_file(): diff --git a/src/PIL/QoiImagePlugin.py b/src/PIL/QoiImagePlugin.py index 5c3407503..66344faac 100644 --- a/src/PIL/QoiImagePlugin.py +++ b/src/PIL/QoiImagePlugin.py @@ -55,7 +55,7 @@ class QoiDecoder(ImageFile.PyDecoder): while len(data) < self.state.xsize * self.state.ysize * bands: byte = self.fd.read(1)[0] if byte == 0b11111110: # QOI_OP_RGB - value = self.fd.read(3) + o8(255) + value = self.fd.read(3) + self._previous_pixel[3:] elif byte == 0b11111111: # QOI_OP_RGBA value = self.fd.read(4) else: