Use 'original' size for aspect ratio

This commit is contained in:
Alex Gleason 2021-05-12 15:04:31 -05:00
parent a3b2e007d3
commit 01dcd9ac2a
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -296,7 +296,7 @@ class MediaGallery extends React.PureComponent {
getSizeDataSingle = () => { getSizeDataSingle = () => {
const { media, defaultWidth } = this.props; const { media, defaultWidth } = this.props;
const width = this.state.width || defaultWidth; const width = this.state.width || defaultWidth;
const aspectRatio = media.getIn([0, 'meta', 'small', 'aspect']); const aspectRatio = media.getIn([0, 'meta', 'original', 'aspect']);
const getHeight = () => { const getHeight = () => {
if (!aspectRatio) return width*9/16; if (!aspectRatio) return width*9/16;
@ -323,7 +323,7 @@ class MediaGallery extends React.PureComponent {
let itemsDimensions = []; let itemsDimensions = [];
const ratios = Array(size).fill().map((_, i) => const ratios = Array(size).fill().map((_, i) =>
media.getIn([i, 'meta', 'small', 'aspect']), media.getIn([i, 'meta', 'original', 'aspect']),
); );
const [ar1, ar2, ar3, ar4] = ratios; const [ar1, ar2, ar3, ar4] = ratios;