High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix: exposure info and better readability (#24344)
Alex75dde0d07676
diff --git a/mobile/lib/domain/models/exif.model.dart b/mobile/lib/domain/models/exif.model.dartindex 84456b6dcc..46e2352ac8 100644--- a/mobile/lib/domain/models/exif.model.dart+++ b/mobile/lib/domain/models/exif.model.dart@@ -37,7 +37,7 @@ class ExifInfo {String get fNumber => f == null ? "" : f!.toStringAsFixed(1);- String get focalLength => mm == null ? "" : mm!.toStringAsFixed(1);+ String get focalLength => mm == null ? "" : mm!.toStringAsFixed(3);const ExifInfo({this.assetId,diff --git a/mobile/lib/infrastructure/entities/exif.entity.dart b/mobile/lib/infrastructure/entities/exif.entity.dartindex f858e8b463..2dbe05b9d7 100644--- a/mobile/lib/infrastructure/entities/exif.entity.dart+++ b/mobile/lib/infrastructure/entities/exif.entity.dart@@ -166,5 +166,6 @@ extension RemoteExifEntityDataDomainEx on RemoteExifEntityData {mm: focalLength?.toDouble(),lens: lens,isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),+ exposureSeconds: ExifDtoConverter.exposureTimeToSeconds(exposureTime),);}diff --git a/mobile/lib/infrastructure/utils/exif.converter.dart b/mobile/lib/infrastructure/utils/exif.converter.dartindex eb9945f454..50639e8e42 100644--- a/mobile/lib/infrastructure/utils/exif.converter.dart+++ b/mobile/lib/infrastructure/utils/exif.converter.dart@@ -22,7 +22,7 @@ abstract final class ExifDtoConverter {f: dto.fNumber?.toDouble(),mm: dto.focalLength?.toDouble(),iso: dto.iso?.toInt(),- exposureSeconds: _exposureTimeToSeconds(dto.exposureTime),+ exposureSeconds: exposureTimeToSeconds(dto.exposureTime),);}@@ -36,15 +36,15 @@ abstract final class ExifDtoConverter {return isRotated90CW || isRotated270CW;}- static double? _exposureTimeToSeconds(String? s) {- if (s == null) {+ static double? exposureTimeToSeconds(String? second) {+ if (second == null) {return null;}- double? value = double.tryParse(s);+ double? value = double.tryParse(second);if (value != null) {return value;}- final parts = s.split("/");+ final parts = second.split("/");if (parts.length == 2) {final numerator = double.tryParse(parts.firstOrNull ?? "-");final denominator = double.tryParse(parts.lastOrNull ?? "-");diff --git a/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet.widget.dart b/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet.widget.dartindex 276034d3d6..80840d94b4 100644--- a/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet.widget.dart+++ b/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet.widget.dart@@ -251,8 +251,8 @@ class _AssetDetailBottomSheet extends ConsumerWidget {color: context.textTheme.labelLarge?.color,),subtitle: _getFileInfo(asset, exifInfo),- subtitleStyle: context.textTheme.bodyMedium?.copyWith(- color: context.textTheme.bodyMedium?.color?.withAlpha(155),+ subtitleStyle: context.textTheme.labelMedium?.copyWith(+ color: context.textTheme.labelMedium?.color?.withAlpha(200),),);},@@ -268,8 +268,8 @@ class _AssetDetailBottomSheet extends ConsumerWidget {color: context.textTheme.labelLarge?.color,),subtitle: _getFileInfo(asset, exifInfo),- subtitleStyle: context.textTheme.bodyMedium?.copyWith(- color: context.textTheme.bodyMedium?.color?.withAlpha(155),+ subtitleStyle: context.textTheme.labelMedium?.copyWith(+ color: context.textTheme.labelMedium?.color?.withAlpha(200),),);}@@ -280,7 +280,7 @@ class _AssetDetailBottomSheet extends ConsumerWidget {// Asset Date and TimeSheetTile(title: _getDateTime(context, asset, exifInfo),- titleStyle: context.textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.w600),+ titleStyle: context.textTheme.labelLarge,trailing: asset.hasRemote && isOwner ? const Icon(Icons.edit, size: 18) : null,onTap: asset.hasRemote && isOwner ? () async => await _editDateTime(context, ref) : null,),@@ -289,7 +289,7 @@ class _AssetDetailBottomSheet extends ConsumerWidget {const SheetLocationDetails(),// Details headerSheetTile(- title: 'exif_bottom_sheet_details'.t(context: context),+ title: 'details'.t(context: context).toUpperCase(),titleStyle: context.textTheme.labelMedium?.copyWith(color: context.textTheme.labelMedium?.color?.withAlpha(200),fontWeight: FontWeight.w600,@@ -298,29 +298,33 @@ class _AssetDetailBottomSheet extends ConsumerWidget {// File infobuildFileInfoTile(),// Camera info- if (cameraTitle != null)+ if (cameraTitle != null) ...[+ const SizedBox(height: 16),SheetTile(title: cameraTitle,titleStyle: context.textTheme.labelLarge,leading: Icon(Icons.camera_alt_outlined, size: 24, color: context.textTheme.labelLarge?.color),subtitle: _getCameraInfoSubtitle(exifInfo),- subtitleStyle: context.textTheme.bodyMedium?.copyWith(- color: context.textTheme.bodyMedium?.color?.withAlpha(155),+ subtitleStyle: context.textTheme.labelMedium?.copyWith(+ color: context.textTheme.labelMedium?.color?.withAlpha(200),),),+ ],// Lens info- if (lensTitle != null)+ if (lensTitle != null) ...[+ const SizedBox(height: 16),SheetTile(title: lensTitle,titleStyle: context.textTheme.labelLarge,leading: Icon(Icons.camera_outlined, size: 24, color: context.textTheme.labelLarge?.color),subtitle: _getLensInfoSubtitle(exifInfo),- subtitleStyle: context.textTheme.bodyMedium?.copyWith(- color: context.textTheme.bodyMedium?.color?.withAlpha(155),+ subtitleStyle: context.textTheme.labelMedium?.copyWith(+ color: context.textTheme.labelMedium?.color?.withAlpha(200),),),+ ],// Appears in (Albums)- _buildAppearsInList(ref, context),+ Padding(padding: const EdgeInsets.only(top: 16.0), child: _buildAppearsInList(ref, context)),// padding at the bottom to avoid cut-offconst SizedBox(height: 100),],diff --git a/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet/sheet_location_details.widget.dart b/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet/sheet_location_details.widget.dartindex 05d19476c6..4edd6855a8 100644--- a/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet/sheet_location_details.widget.dart+++ b/mobile/lib/presentation/widgets/asset_viewer/bottom_sheet/sheet_location_details.widget.dart@@ -78,7 +78,7 @@ class _SheetLocationDetailsState extends ConsumerState<SheetLocationDetails> {crossAxisAlignment: CrossAxisAlignment.start,children: [SheetTile(- title: 'exif_bottom_sheet_location'.t(context: context),+ title: 'location'.t(context: context).toUpperCase(),titleStyle: context.textTheme.labelMedium?.copyWith(color: context.textTheme.labelMedium?.color?.withAlpha(200),fontWeight: FontWeight.w600,@@ -102,7 +102,7 @@ class _SheetLocationDetailsState extends ConsumerState<SheetLocationDetails> {Text(coordinates,style: context.textTheme.labelMedium?.copyWith(- color: context.textTheme.labelMedium?.color?.withAlpha(150),+ color: context.textTheme.labelMedium?.color?.withAlpha(200),),),],diff --git a/mobile/lib/presentation/widgets/asset_viewer/sheet_tile.widget.dart b/mobile/lib/presentation/widgets/asset_viewer/sheet_tile.widget.dartindex e78aa926aa..2af68e1ff0 100644--- a/mobile/lib/presentation/widgets/asset_viewer/sheet_tile.widget.dart+++ b/mobile/lib/presentation/widgets/asset_viewer/sheet_tile.widget.dart@@ -46,7 +46,7 @@ class SheetTile extends ConsumerWidget {} else {titleWidget = Container(width: double.infinity,- padding: const EdgeInsets.only(left: 15),+ padding: const EdgeInsets.only(left: 15, right: 15),child: Text(title, style: titleStyle),);}