Merge pull request #1138 from Fer-r/feature/webp-image-upload-support

feat: add WebP image upload support
This commit is contained in:
Enno Gelhaus 2025-12-26 04:54:45 +01:00 committed by GitHub
commit 0043029292
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -88,7 +88,7 @@ export function useUppyUploader(props: {
// Expand generic types to specific ones
const expandedTypes = allowedTypes.flatMap((type) => {
if (type === 'image/*') {
return ['image/png', 'image/jpeg', 'image/jpg', 'image/gif'];
return ['image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/webp'];
}
if (type === 'video/*') {
return ['video/mp4', 'video/mpeg'];

View File

@ -12,6 +12,7 @@ export class ValidUrlExtension implements ValidatorConstraintInterface {
!!text?.split?.('?')?.[0].endsWith('.jpg') ||
!!text?.split?.('?')?.[0].endsWith('.jpeg') ||
!!text?.split?.('?')?.[0].endsWith('.gif') ||
!!text?.split?.('?')?.[0].endsWith('.webp') ||
!!text?.split?.('?')?.[0].endsWith('.mp4')
);
}
@ -19,7 +20,7 @@ export class ValidUrlExtension implements ValidatorConstraintInterface {
defaultMessage(args: ValidationArguments) {
// here you can provide default error message if validation failed
return (
'File must have a valid extension: .png, .jpg, .jpeg, .gif, or .mp4'
'File must have a valid extension: .png, .jpg, .jpeg, .gif, .webp, or .mp4'
);
}
}