Fix rendering of images with too small aspect ratios (#29310)

This commit is contained in:
Tiago Peralta 2024-04-04 19:10:23 +01:00
parent 1c87cb8019
commit 6b59494e06

View file

@ -287,7 +287,9 @@ class MediaGallery extends PureComponent {
isFullSizeEligible() {
const { media } = this.props;
return media.size === 1 && media.getIn([0, 'meta', 'small', 'aspect']);
const aspect = media.getIn([0, 'meta', 'small', 'aspect']);
const minAspectRatioThreshold = 3/2;
return media.size === 1 && typeof aspect === 'number' && aspect >= minAspectRatioThreshold;
}
render () {