Opened 9 months ago
Last modified 7 weeks ago
#60798 reopened defect (bug)
Investigate potentially failing Imagick PDF alpha channel test
Reported by: | swissspidy | Owned by: | antpb |
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | needs-patch |
Focuses: | Cc: |
Description (last modified by )
The test \Tests_Image_Editor_Imagick::test_remove_pdf_alpha_channel_should_remove_the_alpha_channel_in_preview()
was introduced in #39216 / [56271].
On some hosting providers, this test appears to be failing with errors such as this:
Tests_Image_Editor_Imagick::test_remove_pdf_alpha_channel_should_remove_the_alpha_channel_in_preview The intermediate size could not be retrieved. Failed asserting that false is of type "array". /tmp/wp-test-runner/tests/phpunit/tests/image/editorImagick.php:680
Examples:
https://make.wordpress.org/hosting/test-results/r57849/wpsabot-r57849/
https://make.wordpress.org/hosting/test-results/r57848/wetopibot-r57848/
We should investigate this failure to see whether it's an issue in core or with the hosting provider.
The test mentions "Ghostscript version >= 9.14", so maybe it's just a matter of skipping the test if the installed Ghostscript version (gs --version
I think) is older than that.
Attachments (2)
Change History (19)
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
9 months ago
#3
@
9 months ago
tl;dr from the above Slack discussion:
\WP_Image_Editor_Imagick::remove_pdf_alpha_channel
is currently checking the ImageMagick version, but it looks like we need to check the Imagick version via phpversion( 'imagick' )
.
So maybe even as simple as version_compare( phpversion( 'imagick' ), '9.14', '>=' )
would work.
#4
@
9 months ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 6.6
I've attached a patch. I'm pretty certain the version check is checking ImageMagick and not the correct imagick version. From the php docs it says the function being used currently only returns the ImageMagick version: https://www.php.net/manual/en/imagick.getversion.php
Imagick::getVersion — Returns the ImageMagick API version
We should just directly do the phpversion() call to the module to get the version. We could use some testing from hosts seeing the test errors.
Prior art also: https://github.com/WordPress/wordpress-develop/blob/4f9b520d3e2531c9ffb9ee5c06a2e2a7e34f9c52/src/wp-admin/includes/class-wp-debug-data.php#L540
For manual testing to ensure this patch doesnt result in a regression please repeat the report here to ensure it is still fixed with this new version check: https://core.trac.wordpress.org/ticket/39216
This ticket was mentioned in Slack in #core-media by swissspidy. View the logs.
9 months ago
#6
@
9 months ago
- Keywords commit added
This looks good to me; it'll definitely help to be checking the right package! ;)
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
6 months ago
#12
@
6 months ago
- Keywords commit removed
- Milestone changed from 6.6 to 6.7
Moving this ticket to the next milestone due to RC1 coming.
#13
@
4 months ago
We just started setting up our automated test reporter and ran into this issue. See https://make.wordpress.org/hosting/test-results/r58902/evermadebot-r58902/
Read the history and looked into the reverted patch.
<?php phpversion( 'imagick' )
reports 3.7.0 which seems to be the latest stable as per PECL so checking against 9.14 feels a bit odd to me. Maybe I'm missing something?
#14
@
4 months ago
- Keywords needs-patch added; dev-feedback has-patch removed
3.7.0 is just the version of the imagick
extension, whereas 9.14 is the version of the ImageMagick library used by imagick
. Two different things.
If we indeed need to check imagick
version, then yes 9.14 is the wrong version to compare to there.
cc @antpb @javiercasares