feat(web): display original heif images for safari (#10478)

This commit is contained in:
Mert 2024-06-19 10:49:59 -04:00 committed by GitHub
parent c58b0ac66a
commit 58b17a866b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -267,6 +267,11 @@ const supportedImageMimeTypes = new Set([
'image/webp',
]);
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755
if (isSafari) {
supportedImageMimeTypes.add('image/heic').add('image/heif');
}
/**
* Returns true if the asset is an image supported by web browsers, false otherwise
*/