Title: WP_Image_Editor_GD::test
Published: April 25, 2014
Last modified: May 20, 2026

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#wp--skip-link--target)

Checks to see if current environment supports GD.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#parameters)󠁿

 `$args`arrayoptional

Default:`array()`

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#return)󠁿

 bool

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#source)󠁿

    ```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() - Ticket #11536.
    	if ( isset( $args['methods'] ) &&
    		in_array( 'rotate', $args['methods'], true ) &&
    		! function_exists( 'imagerotate' ) ) {

    			return false;
    	}

    	return true;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor-gd.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-image-editor-gd.php#L41)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-image-editor-gd.php#L41-L55)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_image_editor_gd/test/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_image_editor_gd%2Ftest%2F)
before being able to contribute a note or feedback.