From 2802b683a8cf10a7a0a282cdca69e84b4d14a748 Mon Sep 17 00:00:00 2001 From: siliconforks Date: Sun, 7 Sep 2025 12:20:24 -0300 Subject: [PATCH] Skip PNG tests failing with ImageMagick 7 See https://core.trac.wordpress.org/ticket/63932 --- tests/phpunit/tests/image/editorImagick.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php index f6390fe3492e1..5e59aa692dee1 100644 --- a/tests/phpunit/tests/image/editorImagick.php +++ b/tests/phpunit/tests/image/editorImagick.php @@ -775,6 +775,13 @@ public function __return_eight() { */ public function test_resizes_are_small_for_16bit_images( $file ) { + if ( DIR_TESTDATA . '/images/png-tests/test8.png' === $file ) { + $version = Imagick::getVersion(); + if ( $version['versionNumber'] >= 0x700 ) { + $this->markTestSkipped( 'ImageMagick 7 is unable to optimize grayscale images with 1-bit transparency.' ); + } + } + $temp_file = DIR_TESTDATA . '/images/test-temp.png'; $imagick_image_editor = new WP_Image_Editor_Imagick( $file ); @@ -831,6 +838,13 @@ public static function data_resizes_are_small_for_16bit_images() { */ public function test_png_color_type_is_preserved_after_resize( $file_path, $expected_color_type ) { + if ( DIR_TESTDATA . '/images/png-tests/test8.png' === $file_path ) { + $version = Imagick::getVersion(); + if ( $version['versionNumber'] >= 0x700 ) { + $this->markTestSkipped( 'ImageMagick 7 is unable to optimize grayscale images with 1-bit transparency.' ); + } + } + $temp_file = DIR_TESTDATA . '/images/test-temp.png'; $imagick_image_editor = new WP_Image_Editor_Imagick( $file_path );