From 1bb68fc0212236a699a8e74a38cbd412f0a22cf2 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 7 Oct 2023 11:22:52 +1100 Subject: [PATCH] fix --- src/_imaging.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/_imaging.c b/src/_imaging.c index 8afed6fca19..795ca5aafc2 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -3760,9 +3760,10 @@ _compare_pixels( // Fortunately, all of the modes that have extra bytes in their pixels use four bytes for their pixels. UINT32 mask = 0xffffffff; if ( - !strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") || + !strcmp(mode, "RGB") || !strcmp(mode, "BGR;24") || !strcmp(mode, "YCbCr") || !strcmp(mode, "HSV") || !strcmp(mode, "LAB") ) { + printf("threeinfour\n"); // These modes have three channels in four bytes, // so we have to ignore the last byte. #ifdef WORDS_BIGENDIAN @@ -3774,6 +3775,9 @@ _compare_pixels( // These modes have two channels in four bytes, // so we have to ignore the middle two bytes. mask = 0xff0000ff; + printf("twoinfour\n"); + } else { + printf("else\n"); } if (mask == 0xffffffff) { @@ -3781,6 +3785,7 @@ _compare_pixels( int y; for (y = 0; y < ysize; y++) { if (memcmp(pixels_a[y], pixels_b[y], linesize)) { + printf("full fail\n"); return 1; } } @@ -3792,11 +3797,13 @@ _compare_pixels( UINT32 *line_b = (UINT32*)pixels_b[y]; for (x = 0; x < xsize; x++, line_a++, line_b++) { if ((*line_a & mask) != (*line_b & mask)) { + printf("mask fail\n"); return 1; } } } } + printf("success\n"); return 0; }