diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 5e9cfd1361..6eca7ba858 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -30,11 +30,13 @@ function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $s if ( ! file_exists( $src_file ) ) { // If the file doesn't exist, attempt a url fopen on the src link. // This can occur with certain file replication plugins. - $src_file = _load_image_to_edit_path( $src, 'full' ); + $src = _load_image_to_edit_path( $src, 'full' ); + } else { + $src = $src_file; } } - $editor = WP_Image_Editor::get_instance( $src_file ); + $editor = WP_Image_Editor::get_instance( $src ); if ( is_wp_error( $editor ) ) return $editor;