From 10141504a2cb8c77995ebd7d98fed193f2c7fa69 Mon Sep 17 00:00:00 2001 From: cford256 Date: Mon, 4 Aug 2025 14:29:51 -0500 Subject: [PATCH] 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> --- server/src/services/metadata.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/services/metadata.service.ts b/server/src/services/metadata.service.ts index 32a3d98f4e..c675b7200d 100644 --- a/server/src/services/metadata.service.ts +++ b/server/src/services/metadata.service.ts @@ -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 => {