Skip to content

Commit 738c03d

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@58417 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 36ee9bd commit 738c03d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp-includes/class-wp-image-editor-imagick.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,9 @@ public function save( $destfilename = null, $mime_type = null ) {
775775
* @since 6.4.0
776776
*/
777777
protected function remove_pdf_alpha_channel() {
778+
$version = Imagick::getVersion();
778779
// Remove alpha channel if possible to avoid black backgrounds for Ghostscript >= 9.14. RemoveAlphaChannel added in ImageMagick 6.7.5.
779-
if ( version_compare( phpversion( 'imagick' ), '9.14', '>=' ) ) {
780+
if ( $version['versionNumber'] >= 0x675 ) {
780781
try {
781782
// Imagick::ALPHACHANNEL_REMOVE mapped to RemoveAlphaChannel in PHP imagick 3.2.0b2.
782783
$this->image->setImageAlphaChannel( defined( 'Imagick::ALPHACHANNEL_REMOVE' ) ? Imagick::ALPHACHANNEL_REMOVE : 12 );

0 commit comments

Comments
 (0)