fix(server): double rotation on HEIF files (#18002)

* fix(server): double rotation on HEIF/HEIC files

* Update server/src/services/media.service.ts

* formatting

---------

Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
This commit is contained in:
Eli Gao 2025-05-01 04:33:18 +08:00 committed by GitHub
parent b845184c80
commit 84b51e3cbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -266,7 +266,9 @@ export class MediaService extends BaseService {
const { info, data, colorspace } = await this.decodeImage(
extracted ? extracted.buffer : asset.originalPath,
asset.exifInfo,
// only specify orientation to extracted images which don't have EXIF orientation data
// or it can double rotate the image
extracted ? asset.exifInfo : { ...asset.exifInfo, orientation: null },
convertFullsize ? undefined : image.preview.size,
);