ethanclevenger91 / pdf-thumbnails-support-test

Determine if your server is missing software for WordPress 4.7's native PDF thumbnail generator.
7 stars 0 forks source link

Enhance Ghostscript test? #1

Open diggy opened 7 years ago

diggy commented 7 years ago

@ethanclevenger91 thanks for this plugin :)

The current test for GS is failing for me, even though the package is installed:

    if(`which gs`) {
      return true;
    }
    return false;

This SO answer suggested ghostscript might be writing the data to STDERR instead of STDOUT.

Following mod to your plugin fixes my issue:

    $retval = shell_exec( 'which gs --version 2>&1' );
    if ( $retval == 0 ) {
        return true;
    }
    return false;

Maybe implement an elseif?

ethanclevenger91 commented 6 years ago

Looks like there are some more things referenced here that could be causing inconsistencies. I'll patch to cover some of these cases.