/** * @return bool Whether WP_Image_Editor_Imagick can be used on this system. */ public static function isImagickAvailable() { static $ret = null; if (is_null($ret)) { $ret = WP_Image_Editor_Imagick::test(); } return $ret; }
public function setUp() { $this->image_path = dirname(__FILE__) . '/data/canola.jpg'; require_once ABSPATH . WPINC . '/class-wp-image-editor.php'; require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php'; if (!WP_Image_Editor_Imagick::test()) { $this->markTestSkipped('WP_Image_Editor_Imagick test failed'); } }
public function setup() { require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' ); $editor = new WP_Image_Editor_Imagick( null ); if ( ! $editor->test() ) $this->markTestSkipped( 'Image Magick not available' ); parent::setUp(); }
/** * Whether the current environment is configured with required methods. * * @since 1.0.0 * * @param array $args * @return bool */ public static function test($args = array()) { if (!parent::test($args)) { return false; } $required_methods = array('clutimage', 'newpseudoimage', 'transformimagecolorspace'); if (array_diff($required_methods, get_class_methods('Imagick'))) { return false; } return true; }
/** * @return bool Whether WP_Image_Editor_Imagick can be used on this system. */ public static function isImagickAvailable() { static $ret = null; if (is_null($ret)) { include_once DG_WPINC_PATH . 'class-wp-image-editor.php'; include_once DG_WPINC_PATH . 'class-wp-image-editor-imagick.php'; $ret = WP_Image_Editor_Imagick::test(); } return $ret; }