[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-09-18 19:49:37 +00:00
parent 97a08ffc91
commit ff49d685a0

View File

@ -3787,10 +3787,8 @@ _compare_pixels(
// Fortunately, all of the modes that have extra bytes in their pixels // Fortunately, all of the modes that have extra bytes in their pixels
// use four bytes for their pixels. // use four bytes for their pixels.
UINT32 mask = 0xffffffff; UINT32 mask = 0xffffffff;
if ( if (!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") || !strcmp(mode, "HSV") ||
!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") || !strcmp(mode, "LAB")) {
!strcmp(mode, "HSV") || !strcmp(mode, "LAB")
) {
// These modes have three channels in four bytes, // These modes have three channels in four bytes,
// so we have to ignore the last byte. // so we have to ignore the last byte.
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
@ -3844,11 +3842,8 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
const Imaging img_a = self->image; const Imaging img_a = self->image;
const Imaging img_b = ((ImagingObject *)other)->image; const Imaging img_b = ((ImagingObject *)other)->image;
if ( if (strcmp(img_a->mode, img_b->mode) || img_a->xsize != img_b->xsize ||
strcmp(img_a->mode, img_b->mode) img_a->ysize != img_b->ysize) {
|| img_a->xsize != img_b->xsize
|| img_a->ysize != img_b->ysize
) {
if (op == Py_EQ) { if (op == Py_EQ) {
Py_RETURN_FALSE; Py_RETURN_FALSE;
} else { } else {
@ -3863,18 +3858,15 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
const UINT8 *palette_b_data = palette_b->palette; const UINT8 *palette_b_data = palette_b->palette;
const UINT8 **palette_a_data_ptr = &palette_a_data; const UINT8 **palette_a_data_ptr = &palette_a_data;
const UINT8 **palette_b_data_ptr = &palette_b_data; const UINT8 **palette_b_data_ptr = &palette_b_data;
if ( if (!palette_a || !palette_b || palette_a->size != palette_b->size ||
!palette_a || !palette_b strcmp(palette_a->mode, palette_b->mode) ||
|| palette_a->size != palette_b->size _compare_pixels(
|| strcmp(palette_a->mode, palette_b->mode)
|| _compare_pixels(
palette_a->mode, palette_a->mode,
1, 1,
palette_a->size * 4, palette_a->size * 4,
palette_a_data_ptr, palette_a_data_ptr,
palette_b_data_ptr palette_b_data_ptr
) )) {
) {
if (op == Py_EQ) { if (op == Py_EQ) {
Py_RETURN_FALSE; Py_RETURN_FALSE;
} else { } else {
@ -3889,8 +3881,7 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
img_a->linesize, img_a->linesize,
(const UINT8 **)img_a->image, (const UINT8 **)img_a->image,
(const UINT8 **)img_b->image (const UINT8 **)img_b->image
) )) {
) {
if (op == Py_EQ) { if (op == Py_EQ) {
Py_RETURN_FALSE; Py_RETURN_FALSE;
} else { } else {