mirror of
https://github.com/immich-app/immich.git
synced 2025-01-28 00:59:18 -05: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:
parent
3a3676bc82
commit
3eee6c4dcf
1 changed files with 5 additions and 0 deletions
|
@ -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
|
* Returns true if the asset is an image supported by web browsers, false otherwise
|
||||||
*/
|
*/
|
||||||
export function isWebCompatibleImage(asset: AssetResponseDto): boolean {
|
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);
|
const imgExtension = getFilenameExtension(asset.originalPath);
|
||||||
|
|
||||||
return supportedImageExtensions.has(imgExtension);
|
return supportedImageExtensions.has(imgExtension);
|
||||||
|
|
Loading…
Add table
Reference in a new issue