From 126c95972c56abdc22c057fdb777242630b68fc5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 5 Jun 2020 16:33:27 +0100 Subject: [PATCH] MImageBody thumbnail use thumbnail_info for max w and h Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/messages/MImageBody.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/views/messages/MImageBody.js b/src/components/views/messages/MImageBody.js index ad238a728ed..4b1431acba1 100644 --- a/src/components/views/messages/MImageBody.js +++ b/src/components/views/messages/MImageBody.js @@ -324,10 +324,14 @@ export default class MImageBody extends React.Component { let infoWidth; let infoHeight; - if (content && content.info && content.info.w && content.info.h) { - infoWidth = content.info.w; - infoHeight = content.info.h; - } else { + const info = content && content.info; + if (info && info.thumbnail_info && info.thumbnail_info.w && info.thumbnail_info.h) { + infoWidth = info.thumbnail_info.w; + infoHeight = info.thumbnail_info.h; + } else if (info && info.w && info.h) { + infoWidth = info.w; + infoHeight = info.h; + } else if (!this.state.loadedImageDimensions) { // Whilst the image loads, display nothing. // // Once loaded, use the loaded image dimensions stored in `loadedImageDimensions`. @@ -409,7 +413,7 @@ export default class MImageBody extends React.Component { { showPlaceholder &&