Skip to content

Commit

Permalink
Merge pull request #7357 from radarhere/qoi
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Sep 4, 2023
2 parents 10d4595 + 7bf7ff8 commit faa2375
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Tests/test_file_qoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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():
Expand All @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/QoiImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def decode(self, buffer):
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:
Expand Down

0 comments on commit faa2375

Please sign in to comment.