mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-03 19:33:07 +03:00
Apply suggestions from code review
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
a4f477565a
commit
506691729a
|
@ -29,7 +29,7 @@ def _test_img_equals_pyarray(
|
||||||
px = img.load()
|
px = img.load()
|
||||||
assert px is not None
|
assert px is not None
|
||||||
if elts_per_pixel > 1 and mask is None:
|
if elts_per_pixel > 1 and mask is None:
|
||||||
# have to do element wise comparison when we're comparing
|
# have to do element-wise comparison when we're comparing
|
||||||
# flattened r,g,b,a to a pixel.
|
# flattened r,g,b,a to a pixel.
|
||||||
mask = list(range(elts_per_pixel))
|
mask = list(range(elts_per_pixel))
|
||||||
for x in range(0, img.size[0], int(img.size[0] / 10)):
|
for x in range(0, img.size[0], int(img.size[0] / 10)):
|
||||||
|
@ -56,7 +56,7 @@ def _test_img_equals_int32_pyarray(
|
||||||
px = img.load()
|
px = img.load()
|
||||||
assert px is not None
|
assert px is not None
|
||||||
if mask is None:
|
if mask is None:
|
||||||
# have to do element wise comparison when we're comparing
|
# have to do element-wise comparison when we're comparing
|
||||||
# flattened rgba in an uint32 to a pixel.
|
# flattened rgba in an uint32 to a pixel.
|
||||||
mask = list(range(elts_per_pixel))
|
mask = list(range(elts_per_pixel))
|
||||||
for x in range(0, img.size[0], int(img.size[0] / 10)):
|
for x in range(0, img.size[0], int(img.size[0] / 10)):
|
||||||
|
|
|
@ -757,7 +757,7 @@ ImagingNewArrow(
|
||||||
if (strcmp(schema->format, "C") == 0 // uint8
|
if (strcmp(schema->format, "C") == 0 // uint8
|
||||||
&& im->pixelsize == 4 // storage as 32 bpc
|
&& im->pixelsize == 4 // storage as 32 bpc
|
||||||
&& schema->n_children == 0 // make sure schema is well formed.
|
&& schema->n_children == 0 // make sure schema is well formed.
|
||||||
&& strcmp(im->arrow_band_format, "C") == 0 // Expected Format
|
&& strcmp(im->arrow_band_format, "C") == 0 // expected format
|
||||||
&& 4 * pixels == external_array->length) { // expected length
|
&& 4 * pixels == external_array->length) { // expected length
|
||||||
// single flat array, interleaved storage.
|
// single flat array, interleaved storage.
|
||||||
if (ImagingBorrowArrow(im, external_array, 1, array_capsule)) {
|
if (ImagingBorrowArrow(im, external_array, 1, array_capsule)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user