Skip to content

Commit 224cb68

Browse files
committed
Use paste
1 parent a048198 commit 224cb68

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Tests/test_image_resample.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,22 +632,20 @@ def test_skip_vertical(self, flt: Image.Resampling) -> None:
632632
class TestCoreResample16bpc:
633633
# Lanczos weighting during downsampling can push accumulated float sums
634634
@pytest.mark.parametrize(
635-
"width_range",
635+
"x",
636636
(
637637
# below 0. These must be clamped to 0, not corrupted byte-by-byte.
638-
(0, 50), # Left half = 65535, right half = 0
638+
0, # Left half = 65535, right half = 0
639639
# above 65535. These must be clamped to 65535, not corrupted byte-by-byte.
640-
(50, 100), # # Left half = 0, right half = 65535
640+
50, # # Left half = 0, right half = 65535
641641
),
642642
)
643-
def test_resampling_clamp_overflow(self, width_range: tuple[int, int]) -> None:
643+
def test_resampling_clamp_overflow(self, x: int) -> None:
644644
ims = {}
645645
width, height = 100, 10
646646
for mode in ("I;16", "F"):
647647
im = Image.new(mode, (width, height))
648-
for y in range(height):
649-
for x in range(*width_range):
650-
im.putpixel((x, y), 65535)
648+
im.paste(65535, (x, 0, x + width // 2, height))
651649

652650
# 5x downsampling with Lanczos
653651
# creates ~8.7% overshoot or undershoot at the step edge

0 commit comments

Comments
 (0)