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: original-sized previews for non-web-friendly images #14446

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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 e2e/src/api/specs/asset.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@ describe('/asset', () => {

for (const { id, status } of assets) {
expect(status).toBe(AssetMediaStatus.Created);
// longer timeout as the thumbnail generation from full-size raw files can take a while
await utils.waitForWebsocketEvent({ event: 'assetUpload', id });
}

Expand Down
7 changes: 6 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@
"forcing_refresh_library_files": "Forcing refresh of all library files",
"image_format": "Format",
"image_format_description": "WebP produces smaller files than JPEG, but is slower to encode.",
"image_fullsize_enabled": "Enable full-size image preview",
"image_fullsize_enabled_description": "Generate and use full-size image preview for non-web-friendly images (like RAW, HIF) when zoomed in. When \"Prefer embedded preview\" is enabled, embedded previews in RAW photos are used directly without conversion. Original web-friendly images (like JPEG) are always used regardeless of this switch.",
"image_fullsize_quality_description": "Full-size image quality from 1-100. Higher is better, but produces larger files.",
"image_fullsize_title": "Full-size Image Settings",
"image_fullsize_description": "Full-size iamge with stripped metadata, used when zoomed in in the image viewer",
"image_prefer_embedded_preview": "Prefer embedded preview",
"image_prefer_embedded_preview_setting_description": "Use embedded previews in RAW photos as the input to image processing when available. This can produce more accurate colors for some images, but the quality of the preview is camera-dependent and the image may have more compression artifacts.",
"image_prefer_embedded_preview_setting_description": "Use embedded previews in RAW photos as the input to image processing and when available. This can produce more accurate colors for some images, but the quality of the preview is camera-dependent and the image may have more compression artifacts.",
"image_prefer_wide_gamut": "Prefer wide gamut",
"image_prefer_wide_gamut_setting_description": "Use Display P3 for thumbnails. This better preserves the vibrance of images with wide colorspaces, but images may appear differently on old devices with an old browser version. sRGB images are kept as sRGB to avoid color shifts.",
"image_preview_description": "Medium-size image with stripped metadata, used when viewing a single asset and for machine learning",
Expand Down
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.

3 changes: 3 additions & 0 deletions mobile/openapi/lib/model/asset_media_size.dart

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

3 changes: 3 additions & 0 deletions mobile/openapi/lib/model/path_type.dart

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

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

10 changes: 9 additions & 1 deletion 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.

27 changes: 27 additions & 0 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8363,6 +8363,7 @@
},
"AssetMediaSize": {
"enum": [
"fullsize",
"preview",
"thumbnail"
],
Expand Down Expand Up @@ -10089,6 +10090,7 @@
"PathType": {
"enum": [
"original",
"fullsize",
"preview",
"thumbnail",
"encoded_video",
Expand Down Expand Up @@ -11763,6 +11765,27 @@
],
"type": "object"
},
"SystemConfigGeneratedFullsizeImageDto": {
"properties": {
"enabled": {
"type": "boolean"
},
"format": {
"$ref": "#/components/schemas/ImageFormat"
},
"quality": {
"maximum": 100,
"minimum": 1,
"type": "integer"
}
},
"required": [
"enabled",
"format",
"quality"
],
"type": "object"
},
"SystemConfigGeneratedImageDto": {
"properties": {
"format": {
Expand Down Expand Up @@ -11793,6 +11816,9 @@
"extractEmbedded": {
"type": "boolean"
},
"fullsize": {
"$ref": "#/components/schemas/SystemConfigGeneratedFullsizeImageDto"
},
"preview": {
"$ref": "#/components/schemas/SystemConfigGeneratedImageDto"
},
Expand All @@ -11803,6 +11829,7 @@
"required": [
"colorspace",
"extractEmbedded",
"fullsize",
"preview",
"thumbnail"
],
Expand Down
8 changes: 8 additions & 0 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,11 @@ export type SystemConfigFFmpegDto = {
transcode: TranscodePolicy;
twoPass: boolean;
};
export type SystemConfigGeneratedFullsizeImageDto = {
enabled: boolean;
format: ImageFormat;
quality: number;
};
export type SystemConfigGeneratedImageDto = {
format: ImageFormat;
quality: number;
Expand All @@ -1131,6 +1136,7 @@ export type SystemConfigGeneratedImageDto = {
export type SystemConfigImageDto = {
colorspace: Colorspace;
extractEmbedded: boolean;
fullsize: SystemConfigGeneratedFullsizeImageDto;
preview: SystemConfigGeneratedImageDto;
thumbnail: SystemConfigGeneratedImageDto;
};
Expand Down Expand Up @@ -3464,6 +3470,7 @@ export enum AssetJobName {
TranscodeVideo = "transcode-video"
}
export enum AssetMediaSize {
Fullsize = "fullsize",
Preview = "preview",
Thumbnail = "thumbnail"
}
Expand Down Expand Up @@ -3514,6 +3521,7 @@ export enum PathEntityType {
}
export enum PathType {
Original = "original",
Fullsize = "fullsize",
Preview = "preview",
Thumbnail = "thumbnail",
EncodedVideo = "encoded_video",
Expand Down
8 changes: 7 additions & 1 deletion server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
VideoContainer,
} from 'src/enum';
import { ConcurrentQueueName, QueueName } from 'src/interfaces/job.interface';
import { ImageOptions } from 'src/interfaces/media.interface';
import { FullsizeImageOptions, ImageOptions } from 'src/interfaces/media.interface';

export interface SystemConfig {
backup: {
Expand Down Expand Up @@ -112,6 +112,7 @@ export interface SystemConfig {
preview: ImageOptions;
colorspace: Colorspace;
extractEmbedded: boolean;
fullsize: FullsizeImageOptions;
};
newVersionCheck: {
enabled: boolean;
Expand Down Expand Up @@ -281,6 +282,11 @@ export const defaults = Object.freeze<SystemConfig>({
},
colorspace: Colorspace.P3,
extractEmbedded: false,
fullsize: {
enabled: false,
format: ImageFormat.JPEG,
quality: 80,
},
},
newVersionCheck: {
enabled: true,
Expand Down
Loading
Loading