feat(web): load original image when zooming (#4040)

* feat(web): change max zoom from 4 to 10

* feat(web): load original image when zooming
This commit is contained in:
Louis-Marie Michelin 2023-09-12 17:42:41 +02:00 committed by GitHub
parent 52d0c5fc73
commit bf3b38a7f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 5 deletions

View file

@ -173,3 +173,15 @@ export function getAssetRatio(asset: AssetResponseDto) {
}
return { width, height };
}
// list of supported image extensions from https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types excluding svg
const supportedImageExtensions = new Set(['apng', 'avif', 'gif', 'jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp', 'png', 'webp']);
/**
* Returns true if the asset is an image supported by web browsers, false otherwise
*/
export function isWebCompatibleImage(asset: AssetResponseDto): boolean {
const imgExtension = getFilenameExtension(asset.originalPath);
return supportedImageExtensions.has(imgExtension);
}