WP_Image_Editor_GD::test( array $args = array() )

Checks to see if current environment supports GD.


Parameters

$args

(Optional)

Default value: array()


Return

(bool)


Source

File: wp-includes/class-wp-image-editor-gd.php

	public static function test( $args = array() ) {
		if ( ! extension_loaded('gd') || ! function_exists('gd_info') )
			return false;

		// On some setups GD library does not provide imagerotate() - https://core.trac.wordpress.org/ticket/11536
		if ( isset( $args['methods'] ) &&
			 in_array( 'rotate', $args['methods'] ) &&
			 ! function_exists('imagerotate') ){

				return false;
		}

		return true;
	}

Changelog

Changelog
Version Description
WP-3.5.0 Introduced.