Add avif image file support (#32508)
Most modern browsers support it now ` Update ALLOWED_TYPES #96 ` https://gitea.com/gitea/docs/pulls/96 --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
68731c07c5
commit
6f1de0a9e5
7 changed files with 81 additions and 25 deletions
|
@ -165,7 +165,7 @@ export function sleep(ms: number): Promise<void> {
|
|||
}
|
||||
|
||||
export function isImageFile({name, type}: {name: string, type?: string}): boolean {
|
||||
return /\.(jpe?g|png|gif|webp|svg|heic)$/i.test(name || '') || type?.startsWith('image/');
|
||||
return /\.(avif|jpe?g|png|gif|webp|svg|heic)$/i.test(name || '') || type?.startsWith('image/');
|
||||
}
|
||||
|
||||
export function isVideoFile({name, type}: {name: string, type?: string}): boolean {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue