Skip to content

High performance self-hosted photo and video management solution.

feat(mobile): limit max zoom by image pixel size (#32423)

Luis Nachtigallb246fa7c8a45
diff --git a/mobile/lib/presentation/widgets/asset_viewer/asset_page.widget.dart b/mobile/lib/presentation/widgets/asset_viewer/asset_page.widget.dart
index 663360ef61..09718b562d 100644
--- a/mobile/lib/presentation/widgets/asset_viewer/asset_page.widget.dart
+++ b/mobile/lib/presentation/widgets/asset_viewer/asset_page.widget.dart
@@ -57,7 +57,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
final _scrollController = SnapScrollController();
double _snapOffset = 0.0;
- static const double _maxScaleMultiplier = 20.0;
+ static const double _maxImagePixelSize = 12.0;
DragStartDetails? _dragStart;
_DragIntent _dragIntent = _DragIntent.none;
@@ -374,7 +374,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
filterQuality: FilterQuality.high,
tightMode: true,
enablePanAlways: true,
- maxScale: PhotoViewComputedScale.contained * _maxScaleMultiplier,
+ maxScale: _maxImagePixelSize,
disableScaleGestures: _showingDetails,
scaleStateChangedCallback: _onScaleStateChanged,
onPageBuild: _onPageBuild,
@@ -409,7 +409,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
basePosition: Alignment.center,
disableScaleGestures: _showingDetails,
minScale: PhotoViewComputedScale.contained,
- maxScale: PhotoViewComputedScale.contained * _maxScaleMultiplier,
+ maxScale: _maxImagePixelSize,
initialScale: PhotoViewComputedScale.contained,
tightMode: true,
onPageBuild: _onPageBuild,