#101 Add loading spinner
This commit is contained in:
@@ -254,6 +254,18 @@ class Immich {
|
||||
return baseUrl + query
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the correct preview size, depending on the image MIME type
|
||||
*/
|
||||
getPreviewImageSize (asset: Asset) {
|
||||
// For certain media types, use the original file rather than the preview
|
||||
if (['image/gif'].includes(asset.originalMimeType || '')) {
|
||||
return ImageSize.original
|
||||
} else {
|
||||
return ImageSize.preview
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the image data URL for a photo
|
||||
*/
|
||||
|
||||
+1
-5
@@ -119,11 +119,7 @@ class Render {
|
||||
}
|
||||
|
||||
const thumbnailUrl = baseUrl + immich.photoUrl(share.key, asset.id, ImageSize.thumbnail)
|
||||
|
||||
// For certain media types, use the original file rather than the preview
|
||||
const originalSizeMimes = ['image/gif']
|
||||
|
||||
const previewUrl = immich.photoUrl(share.key, asset.id, originalSizeMimes.includes(asset.originalMimeType || '') ? ImageSize.original : ImageSize.preview)
|
||||
const previewUrl = immich.photoUrl(share.key, asset.id, immich.getPreviewImageSize(asset))
|
||||
const description = getConfigOption('ipp.showMetadata.description', false) && typeof asset?.exifInfo?.description === 'string' ? asset.exifInfo.description.replace(/'/g, ''') : ''
|
||||
|
||||
// Create the full HTML element source to pass to the gallery view
|
||||
|
||||
Reference in New Issue
Block a user