Ticket #22738: 22738.2.diff
File 22738.2.diff, 1.2 KB (added by , 11 years ago) |
---|
-
wp-includes/media.php
1375 1375 1376 1376 // Nothing from the filter, so consult image metadata if we have it. 1377 1377 $size_meta = $meta['sizes'][ $size ]; 1378 1379 // We have the actual image size, but might need to further constrain it if content_width is narrower. 1380 // This is not necessary for thumbnails and medium size. 1381 if ( 'thumbnail' == $size || 'medium' == $size ) { 1382 $width = $size_meta['width']; 1383 $height = $size_meta['height']; 1384 } else { 1385 list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size ); 1386 } 1387 1378 1388 $sizes[ $size ] = array( 1379 'height' => $ size_meta['height'],1380 'width' => $ size_meta['width'],1389 'height' => $height, 1390 'width' => $width, 1381 1391 'url' => $base_url . $size_meta['file'], 1382 'orientation' => $ size_meta['height'] > $size_meta['width']? 'portrait' : 'landscape',1392 'orientation' => $height > $width ? 'portrait' : 'landscape', 1383 1393 ); 1384 1394 } 1385 1395 }