#162 #258 Serve fullsize image on zoom (configurable)

This commit is contained in:
Alan Grainger
2026-06-30 13:01:54 +12:00
parent 494fbe36c7
commit 00da9018cf
18 changed files with 561 additions and 135 deletions
+10
View File
@@ -1,6 +1,7 @@
import { Asset, ImageSize } from '../types'
import { getConfigOption } from '../config/access'
import { sanitize } from '../utils/sanitize'
import { resolveImageEndpoint } from './sizing'
/**
* Map an Immich asset MIME type to a file extension (including the dot).
@@ -89,3 +90,12 @@ export function getFilename (asset: Asset, servedSize: ImageSize = ImageSize.ori
}
}
}
/**
* Filename for a downloaded asset, whose extension matches the bytes a download
* (`/original` request) actually returns after the `maxDownloadQuality` clamp.
* Used by both the eager (gallery builder) and lazy (`/meta/`) item paths.
*/
export function downloadFilename (asset: Asset): string {
return getFilename(asset, resolveImageEndpoint(ImageSize.original, asset).servedSize)
}