Make WordPress Core

Ticket #55290: image-edits.patch

File image-edits.patch, 1.3 KB (added by mitogh, 3 years ago)
  • src/wp-admin/includes/image-edit.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/includes/image-edit.php b/src/wp-admin/includes/image-edit.php
    a b  
    783783 * @return stdClass
    784784 */
    785785function wp_save_image( $post_id ) {
    786         $_wp_additional_image_sizes = wp_get_additional_image_sizes();
     786        $_wp_additional_image_sizes = wp_get_registered_image_subsizes();
    787787
    788788        $return  = new stdClass;
    789789        $success = false;
     
    960960                                $height = (int) $_wp_additional_image_sizes[ $size ]['height'];
    961961                                $crop   = ( $nocrop ) ? false : $_wp_additional_image_sizes[ $size ]['crop'];
    962962                        } else {
    963                                 $height = get_option( "{$size}_size_h" );
    964                                 $width  = get_option( "{$size}_size_w" );
     963                                $height = (int) get_option( "{$size}_size_h" );
     964                                $width  = (int) get_option( "{$size}_size_w" );
    965965                                $crop   = ( $nocrop ) ? false : get_option( "{$size}_crop" );
    966966                        }
    967967
     
    972972                        );
    973973                }
    974974
    975                 $meta['sizes'] = array_merge( $meta['sizes'], $img->multi_resize( $_sizes ) );
     975                $meta['sizes'] = $img->multi_resize( $_sizes );
    976976        }
    977977
    978978        unset( $img );