fix: exif rating rounding (#20457)

* fix_Exlif_Metadata_Rating_Rounding_to_Interger

Rounding Exlif Rating Interger
Images support having numbers other than integers for the rating metadata in EXLIF. The database expects it to be an integer though. Trying to upload an image that has a rating other than an integer results in it failing to parse the image and defaulting to showing a corrupted file icon. 

Rather than changing the database type, I would like to round the rating to the nearest integer so that Immich works with images that have a rating like this in their metadata.

* Changing Metadata validateRange to always round.

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

Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>

---------

Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
This commit is contained in:
cford256 2025-08-04 14:29:51 -05:00 committed by GitHub
parent 67736c8fce
commit 10141504a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -101,7 +101,7 @@ const validateRange = (value: number | undefined, min: number, max: number): Non
return null;
}
return val;
return Math.round(val);
};
const getLensModel = (exifTags: ImmichTags): string | null => {