Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
t3chguy/msc-is-animated
Michael Telatynski 2024-11-21 13:04:31 +00:00
parent 5a09b081d7
commit 1c3379898e
No known key found for this signature in database
GPG Key ID: A2B008A5F49F5D0D
1 changed files with 6 additions and 2 deletions

View File

@ -298,10 +298,14 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
}
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;
}