From d4159bf041723232992945fc7333af21d006e4a9 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 27 Nov 2012 14:36:55 +0000 Subject: [PATCH] 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: http://core.svn.wordpress.org/trunk@22863 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image-edit.php | 8 ++++---- wp-includes/class-wp-image-editor-gd.php | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 55d590278a..5c3c851540 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -40,14 +40,14 @@ function wp_image_editor($post_id, $msg = false) {
, this)" class="imgedit-crop disabled" title="">
+ if ( wp_image_editor_supports( array( 'mime_type' => get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ) ) ) ) { ?>
, this)" title="">
, this)" title="">
-
-
+
+
, this)" class="imgedit-flipv" title="">
diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 8a5d846d35..92dd28767a 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -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; }