Opened 5 years ago
Last modified 5 years ago
#54039 new enhancement
site health can probably do better job at detecting if imagick supports PDF
| Reported by: | mark-k | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Site Health | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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