We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 433e690 commit 42f736bCopy full SHA for 42f736b
1 file changed
php/class-media.php
@@ -865,8 +865,8 @@ public function get_crop( $url, $attachment_id ) {
865
$cropped = ! wp_image_matches_ratio(
866
// PDFs do not always have width and height, but they do have full sizes.
867
// This is important for the thumbnail crops on the media library.
868
- ! empty( $meta['width'] ) ? $meta['width'] : $meta['sizes']['full']['width'],
869
- ! 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 ),
870
$size['width'],
871
$size['height']
872
);
0 commit comments