1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

fix(mobile): not throwing error when cannot parse orientation value (#13853)

* fix(mobile): not throw when error in parsing the orientation

* fix(mobile): not throw when error in parsing the orientation

* linting
This commit is contained in:
Alex 2024-10-31 09:37:02 -05:00 committed by GitHub
parent a28b92b3cc
commit 343cdcfeed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -524,7 +524,8 @@ bool isRotated270CW(int orientation) {
/// Returns `true` if this [Asset] is flipped 90° or 270° clockwise
bool isFlipped(AssetResponseDto response) {
final int orientation = response.exifInfo?.orientation?.toInt() ?? 0;
final int orientation =
int.tryParse(response.exifInfo?.orientation ?? '0') ?? 0;
return orientation != 0 &&
(isRotated90CW(orientation) || isRotated270CW(orientation));
}