WP_Image_Editor: the last stand.

* Have wp_get_image_editor() rather than WP_Image_Editor::get_instance(). Having static factory methods would be less confusing if there weren't also static methods tied to individual editor implementations.
 * Lazy-load the WP_Image_Editor base class and editor implementations.
 * Have WP_Image_Editor_GD::supports_mime_type() actually check which types it supports.
 * Deprecate gd_edit_image_support() in favor of wp_image_editor_supports().

props DH-Shredder, scribu, markoheijnen. fixes #22356. see #6821.



git-svn-id: https://develop.svn.wordpress.org/trunk@22817 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-11-22 09:52:16 +00:00
parent ff6ae18d2d
commit f44d1d009e
9 changed files with 216 additions and 170 deletions
+2 -2
View File
@@ -457,7 +457,7 @@ function stream_preview_image( $post_id ) {
$post = get_post( $post_id );
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
$img = WP_Image_Editor::get_instance( _load_image_to_edit_path( $post_id ) );
$img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) );
if ( is_wp_error( $img ) )
return false;
@@ -566,7 +566,7 @@ function wp_save_image( $post_id ) {
$success = $delete = $scaled = $nocrop = false;
$post = get_post( $post_id );
$img = WP_Image_Editor::get_instance( _load_image_to_edit_path( $post_id, 'full' ) );
$img = wp_get_image_editor( _load_image_to_edit_path( $post_id, 'full' ) );
if ( is_wp_error( $img ) ) {
$return->error = esc_js( __('Unable to create new image.') );
return $return;