mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
Merge pull request #670 from mauriceboe/fix/immich-heic-rendering
fix(immich): serve fullsize thumbnail for original to fix HEIC rendering
This commit is contained in:
@@ -241,9 +241,10 @@ export async function streamImmichAsset(
|
|||||||
const creds = getImmichCredentials(effectiveUserId);
|
const creds = getImmichCredentials(effectiveUserId);
|
||||||
if (!creds) return { error: 'Not found', status: 404 };
|
if (!creds) return { error: 'Not found', status: 404 };
|
||||||
|
|
||||||
const path = kind === 'thumbnail' ? 'thumbnail' : 'original';
|
|
||||||
const timeout = kind === 'thumbnail' ? 10000 : 30000;
|
const timeout = kind === 'thumbnail' ? 10000 : 30000;
|
||||||
const url = `${creds.immich_url}/api/assets/${assetId}/${path}`;
|
const url = kind === 'thumbnail'
|
||||||
|
? `${creds.immich_url}/api/assets/${assetId}/thumbnail?size=thumbnail`
|
||||||
|
: `${creds.immich_url}/api/assets/${assetId}/thumbnail?size=fullsize`;
|
||||||
|
|
||||||
response.set('Cache-Control', 'public, max-age=86400');
|
response.set('Cache-Control', 'public, max-age=86400');
|
||||||
await pipeAsset(url, response, { 'x-api-key': creds.immich_api_key }, AbortSignal.timeout(timeout));
|
await pipeAsset(url, response, { 'x-api-key': creds.immich_api_key }, AbortSignal.timeout(timeout));
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ describe('Immich asset proxy', () => {
|
|||||||
.set('Cookie', authCookie(member.id));
|
.set('Cookie', authCookie(member.id));
|
||||||
|
|
||||||
expect(res.status).toBe(200);
|
expect(res.status).toBe(200);
|
||||||
expect(res.headers['content-type']).toContain('image/jpeg');
|
expect(res.headers['content-type']).toContain('image/');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('IMMICH-057 — GET /assets/info where trip does not exist returns 403', async () => {
|
it('IMMICH-057 — GET /assets/info where trip does not exist returns 403', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user