Skip to content

Commit 6f9d8e6

Browse files
Media: fix potentially failing Imagick PDF alpha channel test.
Only test PDF alpha functionality when supported by the server. Props: adamsilverstein, swissspidy, antpb, sippis. Fixes #60798. git-svn-id: https://develop.svn.wordpress.org/trunk@60030 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c841475 commit 6f9d8e6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/phpunit/tests/image/editorImagick.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ public function test_remove_pdf_alpha_channel_should_remove_the_alpha_channel_in
656656
$this->markTestSkipped( 'Rendering PDFs is not supported on this system.' );
657657
}
658658

659+
$version = Imagick::getVersion();
660+
if ( $version['versionNumber'] < 0x675 ) {
661+
$this->markTestSkipped( 'The version of ImageMagick does not support removing alpha channels from PDFs.' );
662+
}
663+
659664
$test_file = DIR_TESTDATA . '/images/test-alpha.pdf';
660665
$attachment_id = $this->factory->attachment->create_upload_object( $test_file );
661666
$this->assertNotEmpty( $attachment_id, 'The attachment was not created before testing.' );

0 commit comments

Comments
 (0)