Skip to content

Commit

Permalink
Merge pull request #7355 from radarhere/getpixel
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Aug 30, 2023
2 parents 091ab74 + f9f367f commit a251270
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Tests/test_image_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def check(self, mode, expected_color=None):
def test_basic(self, mode):
self.check(mode)

def test_list(self):
im = hopper()
assert im.getpixel([0, 0]) == (20, 20, 70)

@pytest.mark.parametrize("mode", ("I;16", "I;16B"))
@pytest.mark.parametrize(
"expected_color", (2**15 - 1, 2**15, 2**15 + 1, 2**16 - 1)
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ def getpixel(self, xy):
self.load()
if self.pyaccess:
return self.pyaccess.getpixel(xy)
return self.im.getpixel(xy)
return self.im.getpixel(tuple(xy))

def getprojection(self):
"""
Expand Down

0 comments on commit a251270

Please sign in to comment.