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
This commit is contained in:
antpb 2024-06-14 15:26:09 +00:00
parent 3f8fb3f8c1
commit b647bc78cd
2 changed files with 3 additions and 2 deletions

View File

@ -775,8 +775,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @since 6.4.0 * @since 6.4.0
*/ */
protected function remove_pdf_alpha_channel() { 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. // 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 { try {
// Imagick::ALPHACHANNEL_REMOVE mapped to RemoveAlphaChannel in PHP imagick 3.2.0b2. // Imagick::ALPHACHANNEL_REMOVE mapped to RemoveAlphaChannel in PHP imagick 3.2.0b2.
$this->image->setImageAlphaChannel( defined( 'Imagick::ALPHACHANNEL_REMOVE' ) ? Imagick::ALPHACHANNEL_REMOVE : 12 ); $this->image->setImageAlphaChannel( defined( 'Imagick::ALPHACHANNEL_REMOVE' ) ? Imagick::ALPHACHANNEL_REMOVE : 12 );

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.