Ticket #18532: 18532.patch
File 18532.patch, 1.0 KB (added by , 13 years ago) |
---|
-
wp-includes/media.php
301 301 // The larger ratio fits, and is likely to be a more "snug" fit. 302 302 $ratio = $larger_ratio; 303 303 304 $w = intval( $current_width * $ratio );305 $h = intval( $current_height * $ratio );304 $w = round( $current_width * $ratio ); 305 $h = round( $current_height * $ratio ); 306 306 307 307 // Sometimes, due to rounding, we'll end up with a result like this: 465x700 in a 177x177 box is 117x176... a pixel short 308 308 // We also have issues with recursive calls resulting in an ever-changing result. Contraining to the result of a constraint should yield the original result. … … 312 312 if ( $did_height && $h == $max_height - 1 ) 313 313 $h = $max_height; // Round it up 314 314 315 return a rray( $w, $h);315 return apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height ); 316 316 } 317 317 318 318 /**