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

Commit

Permalink
Allow sending and thumbnailing AVIF images
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Mar 28, 2022
1 parent a3e5231 commit d6eb80d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/Image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import { arrayHasDiff } from "./arrays";

export function mayBeAnimated(mimeType: string): boolean {
return ["image/gif", "image/webp", "image/png", "image/apng"].includes(mimeType);
// AVIF animation support at the time of writing is only available in Chrome hence not having `blobIsAnimated` check
return ["image/gif", "image/webp", "image/png", "image/apng", "image/avif"].includes(mimeType);
}

function arrayBufferRead(arr: ArrayBuffer, start: number, len: number): Uint8Array {
Expand Down
1 change: 1 addition & 0 deletions src/utils/blobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const ALLOWED_BLOB_MIMETYPES = [
'image/png',
'image/apng',
'image/webp',
'image/avif',

'video/mp4',
'video/webm',
Expand Down

0 comments on commit d6eb80d

Please sign in to comment.