From 2377df9daeb6b5ebd412794056adfe555a46099f Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:33:45 +0000 Subject: [PATCH] fix(mobile): store exposure time as string (#4589) Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/shared/models/exif_info.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mobile/lib/shared/models/exif_info.dart b/mobile/lib/shared/models/exif_info.dart index 4609c0487c..568e4ce13a 100644 --- a/mobile/lib/shared/models/exif_info.dart +++ b/mobile/lib/shared/models/exif_info.dart @@ -1,6 +1,5 @@ import 'package:isar/isar.dart'; import 'package:openapi/api.dart'; -import 'package:immich_mobile/utils/builtin_extensions.dart'; part 'exif_info.g.dart'; @@ -165,7 +164,11 @@ double? _exposureTimeToSeconds(String? s) { } final parts = s.split("/"); if (parts.length == 2) { - return parts[0].toDouble() / parts[1].toDouble(); + final numerator = double.tryParse(parts[0]); + final denominator = double.tryParse(parts[1]); + if (numerator != null && denominator != null) { + return numerator / denominator; + } } return null; }