Make WordPress Core

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's profile mark-k Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Site Health Keywords:
Focuses: Cc:


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 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)

#1 @nosilver4u
3 years ago

Indeed, one can use the queryFormats() method to check which file types are supported. We use this in EWWW IO for several mime types:

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

3 years ago

#3 @antpb
3 years ago

  • Component changed from Media to Site Health

Moving this over to Site Health as I think it may need folks more familiar with the existing checks we have today.

Note: See TracTickets for help on using tickets.