Ticket #23779: 23779.2.diff
File 23779.2.diff, 1.4 KB (added by , 11 years ago) |
---|
-
wp-includes/media.php
1705 1705 'url' => $downsize[0], 1706 1706 'orientation' => $downsize[2] > $downsize[1] ? 'portrait' : 'landscape', 1707 1707 ); 1708 } else if ( isset( $meta['sizes'][ $size ] ) ){1708 } else { 1709 1709 if ( ! isset( $base_url ) ) 1710 1710 $base_url = str_replace( wp_basename( $attachment_url ), '', $attachment_url ); 1711 1711 1712 // Nothing from the filter, so consult image metadata if we have it.1713 $size_meta = $meta['sizes'][ $size ];1712 // If image metadata for this size exists, use it, otherwise use original. 1713 $size_meta = ( isset( $meta['sizes'][ $size ] ) ) ? $meta['sizes'][ $size ] : $meta; 1714 1714 1715 1715 // We have the actual image size, but might need to further constrain it if content_width is narrower. 1716 1716 // Thumbnail, medium, and full sizes are also checked against the site's height/width options. 1717 1717 list( $width, $height ) = image_constrain_size_for_editor( $size_meta['width'], $size_meta['height'], $size, 'edit' ); 1718 1718 1719 // If dimensions have not changed from the original, skip this image size. 1720 if ( $width == $meta['width'] && $height == $meta['height'] ) 1721 continue; 1722 1719 1723 $sizes[ $size ] = array( 1720 1724 'height' => $height, 1721 1725 'width' => $width,