Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): separate quality for thumbnail and preview images #13006

Merged
merged 4 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mobile/openapi/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mobile/openapi/lib/api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions mobile/openapi/lib/api_client.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 118 additions & 0 deletions mobile/openapi/lib/model/system_config_generated_image_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 15 additions & 43 deletions mobile/openapi/lib/model/system_config_image_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 27 additions & 21 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -11654,42 +11654,48 @@
],
"type": "object"
},
"SystemConfigImageDto": {
"SystemConfigGeneratedImageDto": {
"properties": {
"colorspace": {
"$ref": "#/components/schemas/Colorspace"
},
"extractEmbedded": {
"type": "boolean"
},
"previewFormat": {
"format": {
"$ref": "#/components/schemas/ImageFormat"
},
"previewSize": {
"minimum": 1,
"type": "integer"
},
"quality": {
"maximum": 100,
"minimum": 1,
"type": "integer"
},
"thumbnailFormat": {
"$ref": "#/components/schemas/ImageFormat"
},
"thumbnailSize": {
"size": {
"minimum": 1,
"type": "integer"
}
},
"required": [
"format",
"quality",
"size"
],
"type": "object"
},
"SystemConfigImageDto": {
"properties": {
"colorspace": {
"$ref": "#/components/schemas/Colorspace"
},
"extractEmbedded": {
"type": "boolean"
},
"preview": {
"$ref": "#/components/schemas/SystemConfigGeneratedImageDto"
},
"thumbnail": {
"$ref": "#/components/schemas/SystemConfigGeneratedImageDto"
}
},
"required": [
"colorspace",
"extractEmbedded",
"previewFormat",
"previewSize",
"quality",
"thumbnailFormat",
"thumbnailSize"
"preview",
"thumbnail"
],
"type": "object"
},
Expand Down
12 changes: 7 additions & 5 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,14 +1100,16 @@ export type SystemConfigFFmpegDto = {
transcode: TranscodePolicy;
twoPass: boolean;
};
export type SystemConfigGeneratedImageDto = {
format: ImageFormat;
quality: number;
size: number;
};
export type SystemConfigImageDto = {
colorspace: Colorspace;
extractEmbedded: boolean;
previewFormat: ImageFormat;
previewSize: number;
quality: number;
thumbnailFormat: ImageFormat;
thumbnailSize: number;
preview: SystemConfigGeneratedImageDto;
thumbnail: SystemConfigGeneratedImageDto;
};
export type JobSettingsDto = {
concurrency: number;
Expand Down
23 changes: 13 additions & 10 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
VideoContainer,
} from 'src/enum';
import { ConcurrentQueueName, QueueName } from 'src/interfaces/job.interface';
import { ImageOutputConfig } from 'src/interfaces/media.interface';

export interface SystemConfig {
ffmpeg: {
Expand Down Expand Up @@ -109,11 +110,8 @@ export interface SystemConfig {
template: string;
};
image: {
thumbnailFormat: ImageFormat;
thumbnailSize: number;
previewFormat: ImageFormat;
previewSize: number;
quality: number;
thumbnail: ImageOutputConfig;
preview: ImageOutputConfig;
colorspace: Colorspace;
extractEmbedded: boolean;
};
Expand Down Expand Up @@ -259,11 +257,16 @@ export const defaults = Object.freeze<SystemConfig>({
template: '{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}',
},
image: {
thumbnailFormat: ImageFormat.WEBP,
thumbnailSize: 250,
previewFormat: ImageFormat.JPEG,
previewSize: 1440,
quality: 80,
thumbnail: {
format: ImageFormat.WEBP,
size: 250,
quality: 80,
},
preview: {
format: ImageFormat.JPEG,
size: 1440,
quality: 80,
},
colorspace: Colorspace.P3,
extractEmbedded: false,
},
Expand Down
Loading
Loading