diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index dcc0a6cc9d..936f093fae 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -218,7 +218,7 @@ function load_image_to_edit($post_id, $mime_type, $size = 'full') { if ( $filepath && file_exists($filepath) ) { if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) ) $filepath = path_join( dirname($filepath), $data['file'] ); - } elseif ( function_exists('fopen') ) { + } elseif ( WP_Http_Fopen::test() ) { $filepath = wp_get_attachment_url($post_id); } @@ -627,10 +627,11 @@ function wp_save_image($post_id) { update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes); if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) { - if ( $thumb = $meta['sizes']['thumbnail'] ) { - $file_url = wp_get_attachment_url($post_id); + $file_url = wp_get_attachment_url($post_id); + if ( $thumb = $meta['sizes']['thumbnail'] ) $return->thumbnail = path_join( dirname($file_url), $thumb['file'] ); - } + else + $return->thumbnail = "$file_url?w=128&h=128"; } } else { $delete = true;