Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7f6e5ca

Browse files
committed
Tweak comments
1 parent 4f807cc commit 7f6e5ca

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/components/views/messages/MImageBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
289289

290290
await loadPromise;
291291

292-
// Rudimentary validation for whether it is animated, only in encrypted rooms as we have the blob
292+
// Rudimentary validation for whether it is animated, only in encrypted rooms where we have the blob
293293
if (this.props.mediaEventHelper.media.isEncrypted) {
294294
const blob = await this.props.mediaEventHelper.sourceBlob.value;
295295
if (!await blobIsAnimated(content.info.mimetype, blob)) {

src/utils/Image.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
export function mayBeAnimated(mimeType: string): boolean {
18-
// Both GIF and WEBP can be animated, and here we assume they are, as checking is much more difficult.
1918
return ["image/gif", "image/webp"].includes(mimeType);
2019
}
2120

@@ -28,8 +27,6 @@ function arrayBufferReadStr(arr: ArrayBuffer, start: number, len: number): strin
2827
}
2928

3029
export async function blobIsAnimated(mimeType: string, blob: Blob): Promise<boolean> {
31-
if (!mayBeAnimated(mimeType)) return false;
32-
3330
if (mimeType === "image/webp") {
3431
// Only extended file format WEBP images support animation, so grab the expected data range and verify header.
3532
// Based on https://developers.google.com/speed/webp/docs/riff_container#extended_file_format

0 commit comments

Comments
 (0)