mirror of
https://github.com/immich-app/immich.git
synced 2025-01-06 03:46:47 +01:00
feat(server): keep only essential exif in fullsize preview
This commit is contained in:
parent
f01561e1f1
commit
cf0c336c1e
2 changed files with 6 additions and 3 deletions
|
@ -139,7 +139,7 @@ export interface VideoInterfaces {
|
||||||
export interface IMediaRepository {
|
export interface IMediaRepository {
|
||||||
// image
|
// image
|
||||||
extract(input: string, output: string, withExif?: boolean): Promise<boolean>;
|
extract(input: string, output: string, withExif?: boolean): Promise<boolean>;
|
||||||
writeExif(tags: ExifEntity, output: string): Promise<boolean>;
|
writeExif(tags: Partial<ExifEntity>, output: string): Promise<boolean>;
|
||||||
decodeImage(input: string, options: DecodeToBufferOptions): Promise<ImageBuffer>;
|
decodeImage(input: string, options: DecodeToBufferOptions): Promise<ImageBuffer>;
|
||||||
generateThumbnail(input: string, options: GenerateThumbnailOptions, outputFile: string): Promise<void>;
|
generateThumbnail(input: string, options: GenerateThumbnailOptions, outputFile: string): Promise<void>;
|
||||||
generateThumbnail(input: Buffer, options: GenerateThumbnailFromBufferOptions, outputFile: string): Promise<void>;
|
generateThumbnail(input: Buffer, options: GenerateThumbnailFromBufferOptions, outputFile: string): Promise<void>;
|
||||||
|
|
|
@ -269,8 +269,11 @@ export class MediaService extends BaseService {
|
||||||
// use this as origin of preview and thumbnail
|
// use this as origin of preview and thumbnail
|
||||||
decodeInputPath = extractedPath;
|
decodeInputPath = extractedPath;
|
||||||
if (asset.exifInfo) {
|
if (asset.exifInfo) {
|
||||||
// write EXIF, especially orientation and colorspace essential for subsequent processing
|
// write essential orientation and colorspace EXIF for correct fullsize preview and subsequent processing
|
||||||
await this.mediaRepository.writeExif(asset.exifInfo, extractedPath);
|
await this.mediaRepository.writeExif(
|
||||||
|
{ orientation: asset.exifInfo.orientation, colorspace: asset.exifInfo.colorspace },
|
||||||
|
extractedPath,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fullsizePath = StorageCore.getImagePath(asset, AssetPathType.FULLSIZE, image.preview.format);
|
fullsizePath = StorageCore.getImagePath(asset, AssetPathType.FULLSIZE, image.preview.format);
|
||||||
|
|
Loading…
Reference in a new issue