In wp_image_editor(), use wp_image_editor_supports() to check for rotation capabilities rather than directly checking the existence of the imagerotate function.

In WP_Image_Editor_GD::test(), check for existence of imagerotate if the rotate capability is required.

Props DH-Shredder
fixes #22597


git-svn-id: https://develop.svn.wordpress.org/trunk@22863 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-11-27 14:36:55 +00:00
parent f7b3d1a854
commit 8b1ebd858a
2 changed files with 12 additions and 4 deletions
+8
View File
@@ -37,6 +37,14 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
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'] ) &&
! function_exists('imagerotate') ){
return false;
}
return true;
}