Skip to content

Commit

Permalink
fix(mobile): not throwing error when cannot parse orientation value (i…
Browse files Browse the repository at this point in the history
…mmich-app#13853)

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

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

* linting
  • Loading branch information
alextran1502 authored and yosit committed Nov 21, 2024
1 parent 836606b commit afe5bb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mobile/lib/entities/asset.entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

0 comments on commit afe5bb0

Please sign in to comment.