1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 11:24:37 +02:00

fix(web): cannot view image when metadata sharing is turned off for public sharing (#10145)

* fix(web): cannot view image when metadata sharing is turned off for public sharing

* Update web/src/lib/utils/asset-utils.ts

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Alex 2024-06-11 10:23:48 -05:00 committed by GitHub
parent 3a3676bc82
commit 3eee6c4dcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,6 +263,11 @@ const supportedImageExtensions = new Set(['apng', 'avif', 'gif', 'jpg', 'jpeg',
* Returns true if the asset is an image supported by web browsers, false otherwise
*/
export function isWebCompatibleImage(asset: AssetResponseDto): boolean {
// originalPath is undefined when public shared link has metadata option turned off
if (!asset.originalPath) {
return false;
}
const imgExtension = getFilenameExtension(asset.originalPath);
return supportedImageExtensions.has(imgExtension);