We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 94e1d55 + 42f736b commit f44aa0fCopy full SHA for f44aa0f
1 file changed
php/class-media.php
@@ -874,8 +874,8 @@ public function get_crop( $url, $attachment_id ) {
874
$cropped = ! wp_image_matches_ratio(
875
// PDFs do not always have width and height, but they do have full sizes.
876
// This is important for the thumbnail crops on the media library.
877
- ! empty( $meta['width'] ) ? $meta['width'] : $meta['sizes']['full']['width'],
878
- ! empty( $meta['height'] ) ? $meta['height'] : $meta['sizes']['full']['height'],
+ ! empty( $meta['width'] ) ? $meta['width'] : ( ! empty( $meta['sizes']['full']['width'] ) ? $meta['sizes']['full']['width'] : 0 ),
+ ! empty( $meta['height'] ) ? $meta['height'] : ( ! empty( $meta['sizes']['full']['height'] ) ? $meta['sizes']['full']['height'] : 0 ),
879
$size['width'],
880
$size['height']
881
);
0 commit comments