Skip to content

Commit

Permalink
Only specify image size once
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 21, 2024
1 parent a0ab9f4 commit 9c41bf4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,9 @@ def test_roundtrip_bytes_method(self, mode: str) -> None:

@pytest.mark.parametrize(("mode", "pixelsize"), image_modes)
def test_getdata_putdata(self, mode: str, pixelsize: int) -> None:
start_bytes = bytes(range(2 * 2 * pixelsize))
im = Image.frombytes(mode, (2, 2), start_bytes)
im = Image.new(mode, (2, 2))
source_bytes = bytes(range(im.width * im.height * pixelsize))
im.frombytes(source_bytes)

reloaded = Image.new(mode, im.size)
reloaded.putdata(im.getdata())
Expand Down

0 comments on commit 9c41bf4

Please sign in to comment.