mirror of
https://github.com/immich-app/immich.git
synced 2024-12-26 10:50:29 +02:00
fix(mobile): store exposure time as string (#4589)
Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
ad5ba82f50
commit
2377df9dae
@ -1,6 +1,5 @@
|
|||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
import 'package:immich_mobile/utils/builtin_extensions.dart';
|
|
||||||
|
|
||||||
part 'exif_info.g.dart';
|
part 'exif_info.g.dart';
|
||||||
|
|
||||||
@ -165,7 +164,11 @@ double? _exposureTimeToSeconds(String? s) {
|
|||||||
}
|
}
|
||||||
final parts = s.split("/");
|
final parts = s.split("/");
|
||||||
if (parts.length == 2) {
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user