wip: panorama tiling

This commit is contained in:
Mees Frensel
2025-11-28 10:59:39 +01:00
parent 13104d49cd
commit 4348d10ea2
19 changed files with 435 additions and 88 deletions
+97
View File
@@ -3756,6 +3756,103 @@
"x-immich-state": "Stable"
}
},
"/assets/{id}/tiles/{level}/{col}/{row}": {
"get": {
"description": "Download a specific tile from an image at the specified level and position",
"operationId": "getAssetTile",
"parameters": [
{
"name": "col",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
},
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "level",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
},
{
"name": "row",
"required": true,
"in": "path",
"schema": {
"type": "number"
}
},
{
"name": "slug",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Get an image tile",
"tags": [
"Assets"
],
"x-immich-history": [
{
"version": "v2.4.0",
"state": "Added"
},
{
"version": "v2.4.0",
"state": "Stable"
}
],
"x-immich-permission": "asset.view",
"x-immich-state": "Stable"
}
},
"/assets/{id}/video/playback": {
"get": {
"description": "Streams the video file for the specified asset. This endpoint also supports byte range requests.",
@@ -2652,6 +2652,27 @@ export function viewAsset({ id, key, size, slug }: {
...opts
}));
}
/**
* Get an image tile
*/
export function getAssetTile({ col, id, key, level, row, slug }: {
col: number;
id: string;
key?: string;
level: number;
row: number;
slug?: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchBlob<{
status: 200;
data: Blob;
}>(`/assets/${encodeURIComponent(id)}/tiles/${encodeURIComponent(level)}/${encodeURIComponent(col)}/${encodeURIComponent(row)}${QS.query(QS.explode({
key,
slug
}))}`, {
...opts
}));
}
/**
* Play asset video
*/
+7
View File
@@ -55,6 +55,13 @@ export const getAssetThumbnailPath = (id: string) => `/assets/${id}/thumbnail`;
export const getAssetPlaybackPath = (id: string) =>
`/assets/${id}/video/playback`;
export const getAssetTilePath = (
id: string,
level: number,
col: number,
row: number
) => `/assets/${id}/tiles/${level}/${col}/${row}`;
export const getUserProfileImagePath = (userId: string) =>
`/users/${userId}/profile-image`;