mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(server): separate quality for thumbnail and preview images (#13006)
* allow different thumbnail and preview quality, better config structure * update web and api * wording * remove empty line?
This commit is contained in:
parent
4248594ac5
commit
995f0fda47
17 changed files with 369 additions and 198 deletions
|
|
@ -0,0 +1,37 @@
|
|||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class SeparateQualityForThumbnailAndPreview1727471863507 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
update system_metadata
|
||||
set value = jsonb_set(value, '{image}', jsonb_strip_nulls(
|
||||
jsonb_build_object(
|
||||
'preview', jsonb_build_object(
|
||||
'format', value->'image'->'previewFormat',
|
||||
'quality', value->'image'->'quality',
|
||||
'size', value->'image'->'previewSize'),
|
||||
'thumbnail', jsonb_build_object(
|
||||
'format', value->'image'->'thumbnailFormat',
|
||||
'quality', value->'image'->'quality',
|
||||
'size', value->'image'->'thumbnailSize'),
|
||||
'extractEmbedded', value->'extractEmbedded',
|
||||
'colorspace', value->'colorspace'
|
||||
)))
|
||||
where key = 'system-config'`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
update system_metadata
|
||||
set value = jsonb_set(value, '{image}', jsonb_strip_nulls(jsonb_build_object(
|
||||
'previewFormat', value->'image'->'preview'->'format',
|
||||
'previewSize', value->'image'->'preview'->'size',
|
||||
'thumbnailFormat', value->'image'->'thumbnail'->'format',
|
||||
'thumbnailSize', value->'image'->'thumbnail'->'size',
|
||||
'extractEmbedded', value->'extractEmbedded',
|
||||
'colorspace', value->'colorspace',
|
||||
'quality', value->'image'->'preview'->'quality'
|
||||
)))
|
||||
where key = 'system-config'`);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue