1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-24 04:46:50 +02:00

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
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);
}