1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 06:31:58 +00: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));
}