diff --git wp-admin/includes/image-edit.php wp-admin/includes/image-edit.php
index f390b5e..0b06926 100644
|
|
|
function wp_save_image( $post_id ) { |
| 568 | 568 | $post = get_post( $post_id ); |
| 569 | 569 | |
| 570 | 570 | $img = WP_Image_Editor::get_instance( _load_image_to_edit_path( $post_id, 'full' ) ); |
| 571 | | if ( !$img ) { |
| | 571 | if ( is_wp_error( $img ) ) { |
| 572 | 572 | $return->error = esc_js( __('Unable to create new image.') ); |
| 573 | 573 | return $return; |
| 574 | 574 | } |
diff --git wp-admin/includes/image.php wp-admin/includes/image.php
index 2a5123e..01bdbad 100644
|
|
|
function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_ |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $editor = WP_Image_Editor::get_instance( $src_file ); |
| 36 | | $src = $editor->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs ); |
| | 36 | if ( is_wp_error( $editor ) ) |
| | 37 | return $editor; |
| 37 | 38 | |
| | 39 | $src = $editor->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs ); |
| 38 | 40 | if ( is_wp_error( $src ) ) |
| 39 | 41 | return $src; |
| 40 | 42 | |
| … |
… |
function wp_generate_attachment_metadata( $attachment_id, $file ) { |
| 94 | 96 | $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes ); |
| 95 | 97 | |
| 96 | 98 | $editor = WP_Image_Editor::get_instance( $file ); |
| 97 | | $metadata['sizes'] = $editor->multi_resize( $sizes ); |
| | 99 | |
| | 100 | if( ! is_wp_error( $editor ) ) { |
| | 101 | $metadata['sizes'] = $editor->multi_resize( $sizes ); |
| | 102 | } |
| 98 | 103 | |
| 99 | 104 | // fetch additional metadata from exif/iptc |
| 100 | 105 | $image_meta = wp_read_image_metadata( $file ); |
diff --git wp-includes/media.php wp-includes/media.php
index 1fc4383..0894e9b 100644
|
|
|
function image_make_intermediate_size( $file, $width, $height, $crop = false ) { |
| 383 | 383 | if ( $width || $height ) { |
| 384 | 384 | $editor = WP_Image_Editor::get_instance( $file ); |
| 385 | 385 | |
| 386 | | if ( is_wp_error( $editor->resize( $width, $height, $crop ) ) ); |
| | 386 | if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) ); |
| 387 | 387 | return false; |
| 388 | 388 | |
| 389 | 389 | $resized_file = $editor->save(); |