[MM-11777] Add WebP preview support on web (#25784)

* Add webp to webapp image extension list

* Add test webp image and test code

* Change webp test image and move path

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
mkaraki
2024-01-15 15:30:22 +09:00
committed by GitHub
parent f2b488932d
commit 23fcb7728f
3 changed files with 13 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -103,6 +103,18 @@ describe('Upload Files - Image', () => {
testImage(properties);
});
it('MM-T2264_7 - WEBP', () => {
const properties = {
filePath: 'mm_file_testing/Images/WEBP.webp',
fileName: 'WEBP.webp',
originalWidth: 640,
originalHeight: 426,
mimeType: 'image/webp',
};
testImage(properties);
});
});
function testImage(properties) {

View File

@@ -1460,7 +1460,7 @@ export const Constants = {
DEFAULT_CHARACTER_LIMIT: 4000,
IMAGE_TYPE_GIF: 'gif',
TEXT_TYPES: ['txt', 'rtf', 'vtt'],
IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png', 'jpeg', 'tiff', 'tif', 'psd'],
IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png', 'jpeg', 'tiff', 'tif', 'psd', 'webp'],
AUDIO_TYPES: ['mp3', 'wav', 'wma', 'm4a', 'flac', 'aac', 'ogg', 'm4r'],
VIDEO_TYPES: ['mp4', 'avi', 'webm', 'mkv', 'wmv', 'mpg', 'mov', 'flv'],
PRESENTATION_TYPES: ['ppt', 'pptx'],