Opened 3 years ago
Last modified 3 years ago
#54039 new enhancement
site health can probably do better job at detecting if imagick supports PDF
Reported by: | mark-k | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Site Health | Keywords: | |
Focuses: | Cc: |
Description
The current code is
if ( function_exists( 'exec' ) ) { $gs = exec( 'gs --version' ); if ( empty( $gs ) ) { .....
exec
is probably disabled on many hosts which means the test will not run at all.
From looking at https://www.drupal.org/project/media_thumbnails/issues/3207465 it seems that imagick reports whether it supports PDF format as part of its phpinfo output. Maybe there is a direct API to get th information as well.
If this is not robust enough, maybe the test should try to generate an image from a test pdf file.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Indeed, one can use the queryFormats() method to check which file types are supported. We use this in EWWW IO for several mime types: https://github.com/nosilver4u/ewww-image-optimizer/blob/46fc90569822e4ef04cfaf792423911738d6dad9/common.php#L3246