mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04:00
fix(mobile): calculate isFlipped for exif from db (#16797)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
f0f0056fe3
commit
81df812f56
@ -1,4 +1,5 @@
|
|||||||
import 'package:immich_mobile/domain/models/exif.model.dart' as domain;
|
import 'package:immich_mobile/domain/models/exif.model.dart' as domain;
|
||||||
|
import 'package:immich_mobile/infrastructure/utils/exif.converter.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
part 'exif.entity.g.dart';
|
part 'exif.entity.g.dart';
|
||||||
@ -74,6 +75,7 @@ class ExifInfo {
|
|||||||
orientation: orientation,
|
orientation: orientation,
|
||||||
timeZone: timeZone,
|
timeZone: timeZone,
|
||||||
dateTimeOriginal: dateTimeOriginal,
|
dateTimeOriginal: dateTimeOriginal,
|
||||||
|
isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),
|
||||||
latitude: lat,
|
latitude: lat,
|
||||||
longitude: long,
|
longitude: long,
|
||||||
city: city,
|
city: city,
|
||||||
|
@ -9,7 +9,7 @@ abstract final class ExifDtoConverter {
|
|||||||
orientation: dto.orientation,
|
orientation: dto.orientation,
|
||||||
timeZone: dto.timeZone,
|
timeZone: dto.timeZone,
|
||||||
dateTimeOriginal: dto.dateTimeOriginal,
|
dateTimeOriginal: dto.dateTimeOriginal,
|
||||||
isFlipped: _isOrientationFlipped(dto.orientation),
|
isFlipped: isOrientationFlipped(dto.orientation),
|
||||||
latitude: dto.latitude?.toDouble(),
|
latitude: dto.latitude?.toDouble(),
|
||||||
longitude: dto.longitude?.toDouble(),
|
longitude: dto.longitude?.toDouble(),
|
||||||
city: dto.city,
|
city: dto.city,
|
||||||
@ -25,7 +25,7 @@ abstract final class ExifDtoConverter {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _isOrientationFlipped(String? orientation) {
|
static bool isOrientationFlipped(String? orientation) {
|
||||||
final value = orientation == null ? null : int.tryParse(orientation);
|
final value = orientation == null ? null : int.tryParse(orientation);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user