mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(server): strip metadata from thumbnails (#4438)
included all thumbnail metadata. It seems this has to be explicitly disabled. Refs: #4382 feat. basic metadata e2e test fix: use tiff thumbnails in first step + e2e fix fix: revert switch to tiff feat: test metadata of both webp and jpg feat: use upload in e2e test fix: lint strip metadata with exiftool use `withIccProfile` fix e2e formatting run jobs in e2e
This commit is contained in:
parent
1d0dbdff67
commit
c0ebc943d2
4 changed files with 113 additions and 3 deletions
|
|
@ -26,13 +26,16 @@ export class MediaRepository implements IMediaRepository {
|
|||
}
|
||||
|
||||
async resize(input: string | Buffer, output: string, options: ResizeOptions): Promise<void> {
|
||||
const chromaSubsampling = options.quality >= 80 ? '4:4:4' : '4:2:0'; // this is default in libvips (except the threshold is 90), but we need to set it manually in sharp
|
||||
await sharp(input, { failOn: 'none' })
|
||||
.pipelineColorspace(options.colorspace === Colorspace.SRGB ? 'srgb' : 'rgb16')
|
||||
.resize(options.size, options.size, { fit: 'outside', withoutEnlargement: true })
|
||||
.rotate()
|
||||
.withMetadata({ icc: options.colorspace })
|
||||
.toFormat(options.format, { quality: options.quality, chromaSubsampling })
|
||||
.withIccProfile(options.colorspace)
|
||||
.toFormat(options.format, {
|
||||
quality: options.quality,
|
||||
// this is default in libvips (except the threshold is 90), but we need to set it manually in sharp
|
||||
chromaSubsampling: options.quality >= 80 ? '4:4:4' : '4:2:0',
|
||||
})
|
||||
.toFile(output);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue