1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Desktop: Resolves #8175: Add support for AVIF image format

This commit is contained in:
Laurent Cozic 2023-06-05 18:20:15 +01:00
parent 8dfcec249f
commit 90a8d704c1
2 changed files with 5 additions and 2 deletions

View File

@ -776,7 +776,10 @@ const mimeTypes = [
{ t: 'x-conference/x-cooltalk', e: ['ice'] }, { t: 'x-conference/x-cooltalk', e: ['ice'] },
]; ];
// Note: if the list above is ever updated, make sure Markdown doesn't appear twice // Note: if the list above is ever updated, make sure Markdown doesn't appear
// twice. In general, put any change here, so that we know what differs from the
// original list.
mimeTypes.push({ t: 'text/markdown', e: ['md', 'markdown'] }); mimeTypes.push({ t: 'text/markdown', e: ['md', 'markdown'] });
mimeTypes.push({ t: 'image/avif', e: ['avif'] });
module.exports = mimeTypes; module.exports = mimeTypes;

View File

@ -48,7 +48,7 @@ export default class Resource extends BaseItem {
} }
public static isSupportedImageMimeType(type: string) { public static isSupportedImageMimeType(type: string) {
const imageMimeTypes = ['image/jpg', 'image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp']; const imageMimeTypes = ['image/jpg', 'image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp', 'image/avif'];
return imageMimeTypes.indexOf(type.toLowerCase()) >= 0; return imageMimeTypes.indexOf(type.toLowerCase()) >= 0;
} }