From b647bc78cde3549e1420314b8918dee48f958951 Mon Sep 17 00:00:00 2001 From: antpb Date: Fri, 14 Jun 2024 15:26:09 +0000 Subject: [PATCH] Media: Revert r58415 Use `version_compare()` for Imagick version check when removing alpha. This commit is a clean revert of r58415 as tests seem to now be failing with this change. Likely the test needs an update as well to accomodate the new successful version check. Follow-up to [60798]. Props jorbin, hellofromTonya. See #60798. Built from https://develop.svn.wordpress.org/trunk@58417 git-svn-id: http://core.svn.wordpress.org/trunk@57866 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor-imagick.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index eac302d7ce..d38ee6fd63 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -775,8 +775,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @since 6.4.0 */ protected function remove_pdf_alpha_channel() { + $version = Imagick::getVersion(); // Remove alpha channel if possible to avoid black backgrounds for Ghostscript >= 9.14. RemoveAlphaChannel added in ImageMagick 6.7.5. - if ( version_compare( phpversion( 'imagick' ), '9.14', '>=' ) ) { + if ( $version['versionNumber'] >= 0x675 ) { try { // Imagick::ALPHACHANNEL_REMOVE mapped to RemoveAlphaChannel in PHP imagick 3.2.0b2. $this->image->setImageAlphaChannel( defined( 'Imagick::ALPHACHANNEL_REMOVE' ) ? Imagick::ALPHACHANNEL_REMOVE : 12 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 44b6d9a21b..1a52b9a9ff 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-beta2-58416'; +$wp_version = '6.6-beta2-58417'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.