Merge pull request #7355 from radarhere/getpixel

This commit is contained in:
Hugo van Kemenade 2023-08-30 04:42:24 -06:00 committed by GitHub
commit a25127034b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -213,6 +213,10 @@ class TestImageGetPixel(AccessTest):
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)

View File

@ -1565,7 +1565,7 @@ class Image:
self.load()
if self.pyaccess:
return self.pyaccess.getpixel(xy)
return self.im.getpixel(xy)
return self.im.getpixel(tuple(xy))
def getprojection(self):
"""