mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Use "non-zero" consistently
This commit is contained in:
parent
d329207e62
commit
2d6ad5868d
|
@ -270,7 +270,7 @@ def test_render_scale1():
|
||||||
image1_scale1_compare.load()
|
image1_scale1_compare.load()
|
||||||
assert_image_similar(image1_scale1, image1_scale1_compare, 5)
|
assert_image_similar(image1_scale1, image1_scale1_compare, 5)
|
||||||
|
|
||||||
# Non-Zero bounding box
|
# Non-zero bounding box
|
||||||
with Image.open(FILE2) as image2_scale1:
|
with Image.open(FILE2) as image2_scale1:
|
||||||
image2_scale1.load()
|
image2_scale1.load()
|
||||||
with Image.open(FILE2_COMPARE) as image2_scale1_compare:
|
with Image.open(FILE2_COMPARE) as image2_scale1_compare:
|
||||||
|
@ -292,7 +292,7 @@ def test_render_scale2():
|
||||||
image1_scale2_compare.load()
|
image1_scale2_compare.load()
|
||||||
assert_image_similar(image1_scale2, image1_scale2_compare, 5)
|
assert_image_similar(image1_scale2, image1_scale2_compare, 5)
|
||||||
|
|
||||||
# Non-Zero bounding box
|
# Non-zero bounding box
|
||||||
with Image.open(FILE2) as image2_scale2:
|
with Image.open(FILE2) as image2_scale2:
|
||||||
image2_scale2.load(scale=2)
|
image2_scale2.load(scale=2)
|
||||||
with Image.open(FILE2_COMPARE_SCALE2) as image2_scale2_compare:
|
with Image.open(FILE2_COMPARE_SCALE2) as image2_scale2_compare:
|
||||||
|
|
|
@ -403,7 +403,7 @@ class TestCoreResampleCoefficients:
|
||||||
if px[2, 0] != test_color // 2:
|
if px[2, 0] != test_color // 2:
|
||||||
assert test_color // 2 == px[2, 0]
|
assert test_color // 2 == px[2, 0]
|
||||||
|
|
||||||
def test_nonzero_coefficients(self):
|
def test_non_zero_coefficients(self):
|
||||||
# regression test for the wrong coefficients calculation
|
# regression test for the wrong coefficients calculation
|
||||||
# due to bug https://github.com/python-pillow/Pillow/issues/2161
|
# due to bug https://github.com/python-pillow/Pillow/issues/2161
|
||||||
im = Image.new("RGBA", (1280, 1280), (0x20, 0x40, 0x60, 0xFF))
|
im = Image.new("RGBA", (1280, 1280), (0x20, 0x40, 0x60, 0xFF))
|
||||||
|
|
|
@ -105,7 +105,7 @@ encode_loop:
|
||||||
st->head = st->codes[st->probe] >> 20;
|
st->head = st->codes[st->probe] >> 20;
|
||||||
goto encode_loop;
|
goto encode_loop;
|
||||||
} else {
|
} else {
|
||||||
/* Reprobe decrement must be nonzero and relatively prime to table
|
/* Reprobe decrement must be non-zero and relatively prime to table
|
||||||
* size. So, any odd positive number for power-of-2 size. */
|
* size. So, any odd positive number for power-of-2 size. */
|
||||||
if ((st->probe -= ((st->tail << 2) | 1)) < 0) {
|
if ((st->probe -= ((st->tail << 2) | 1)) < 0) {
|
||||||
st->probe += TABLE_SIZE;
|
st->probe += TABLE_SIZE;
|
||||||
|
|
|
@ -74,7 +74,7 @@ typedef struct {
|
||||||
/* Optimize Huffman tables (slow) */
|
/* Optimize Huffman tables (slow) */
|
||||||
int optimize;
|
int optimize;
|
||||||
|
|
||||||
/* Disable automatic conversion of RGB images to YCbCr if nonzero */
|
/* Disable automatic conversion of RGB images to YCbCr if non-zero */
|
||||||
int keep_rgb;
|
int keep_rgb;
|
||||||
|
|
||||||
/* Stream type (0=full, 1=tables only, 2=image only) */
|
/* Stream type (0=full, 1=tables only, 2=image only) */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user