From 1c3379898e823e1ebdef4bc4c155710b7031b3f7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 21 Nov 2024 13:04:31 +0000 Subject: [PATCH] Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/messages/MImageBody.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index 41cefb68bb..7d45e71a4b 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -298,10 +298,14 @@ export default class MImageBody extends React.Component { } try { - const blob = await this.props.mediaEventHelper!.sourceBlob.value; + // If we didn't receive the MSC4230 is_animated flag + // then we need to check if the image is animated by downloading it. if ( content.info?.["org.matrix.msc4230.is_animated"] === false || - !(await blobIsAnimated(content.info?.mimetype, blob)) + !(await blobIsAnimated( + content.info?.mimetype, + await this.props.mediaEventHelper!.sourceBlob.value, + )) ) { isAnimated = false; }