WordPress.org

Make WordPress Core

Ticket #21518: 21518.patch

File 21518.patch, 2.9 KB (added by SergeyBiryukov, 5 years ago)
  • wp-admin/includes/deprecated.php

     
    5555} 
    5656 
    5757/** 
     58 * Calculated the new dimensions for a downsampled image. 
     59 * 
     60 * @since 2.0.0 
     61 * @deprecated 3.5.0 
     62 * @see wp_constrain_dimensions() 
     63 * 
     64 * @param int $width Current width of the image 
     65 * @param int $height Current height of the image 
     66 * @return mixed Array(height,width) of shrunk dimensions. 
     67 */ 
     68function get_udims( $width, $height ) { 
     69        _deprecated_function( __FUNCTION__, '3.5', 'wp_constrain_dimensions()' ); 
     70        return wp_constrain_dimensions( $width, $height, 128, 96 ); 
     71} 
     72 
     73/** 
    5874 * {@internal Missing Short Description}} 
    5975 * 
    6076 * @since 0.71 
  • wp-admin/includes/image-edit.php

     
    414414                $meta['file'] = _wp_relative_upload_path( $restored_file ); 
    415415                $meta['width'] = $data['width']; 
    416416                $meta['height'] = $data['height']; 
    417                 list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); 
    418                 $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; 
    419417        } 
    420418 
    421419        foreach ( $default_sizes as $default_size ) { 
     
    559557                $meta['width'] = imagesx($img); 
    560558                $meta['height'] = imagesy($img); 
    561559 
    562                 list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); 
    563                 $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; 
    564  
    565560                if ( $success && ('nothumb' == $target || 'all' == $target) ) { 
    566561                        $sizes = get_intermediate_image_sizes(); 
    567562                        if ( 'nothumb' == $target ) 
  • wp-admin/includes/image.php

     
    117117                $imagesize = getimagesize( $file ); 
    118118                $metadata['width'] = $imagesize[0]; 
    119119                $metadata['height'] = $imagesize[1]; 
    120                 list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96); 
    121                 $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'"; 
    122120 
    123121                // Make the file path relative to the upload dir 
    124122                $metadata['file'] = _wp_relative_upload_path($file); 
     
    161159} 
    162160 
    163161/** 
    164  * Calculated the new dimensions for a downsampled image. 
    165  * 
    166  * @since 2.0.0 
    167  * @see wp_constrain_dimensions() 
    168  * 
    169  * @param int $width Current width of the image 
    170  * @param int $height Current height of the image 
    171  * @return mixed Array(height,width) of shrunk dimensions. 
    172  */ 
    173 function get_udims( $width, $height) { 
    174         return wp_constrain_dimensions( $width, $height, 128, 96 ); 
    175 } 
    176  
    177 /** 
    178162 * Convert a fraction string to a decimal. 
    179163 * 
    180164 * @since 2.5.0