Ticket #18799: 18799.diff
File 18799.diff, 900 bytes (added by , 13 years ago) |
---|
-
wp-includes/media.php
526 526 if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) ) 527 527 return false; 528 528 529 // check the original image first! 530 if ( is_array( $size ) && ( ( $imagedata['width'] == $size[0] && $imagedata['height'] <= $size[1] ) || ( $imagedata['height'] == $size[1] && $imagedata['width'] <= $size[0] ) ) ) { 531 $file = basename( $imagedata['file'] ); 532 list($width, $height) = image_constrain_size_for_editor( $imagedata['width'], $imagedata['height'], $size ); 533 return compact( 'file', 'width', 'height' ); 534 } 535 529 536 // get the best one for a specified set of dimensions 530 537 if ( is_array($size) && !empty($imagedata['sizes']) ) { 531 538 foreach ( $imagedata['sizes'] as $_size => $data ) {