question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maximum zoom less than minimum

See original GitHub issue

Hello,

First thank you for your amazing work.

I’m facing with an issue where apparently the max zoom is less than minimum :

Fatal Exception: java.lang.IllegalArgumentException: Cannot coerce value to an empty range: maximum 1.235147 is less than minimum 1.3270956. at kotlin.ranges.RangesKt___RangesKt.coerceIn(_Ranges.kt:1052) at com.otaliastudios.zoom.internal.movement.ZoomManager.checkBounds$zoomlayout_release(ZoomManager.kt:121) at com.otaliastudios.zoom.internal.matrix.MatrixController.applyUpdate$zoomlayout_release(MatrixController.kt:263) at com.otaliastudios.zoom.internal.matrix.MatrixController.applyUpdate$zoomlayout_release(MatrixController.kt:238) at com.otaliastudios.zoom.ZoomEngine$Callbacks.onMatrixSizeChanged(ZoomEngine.kt:106) at com.otaliastudios.zoom.internal.matrix.MatrixController.onSizeChanged(MatrixController.kt:206) at com.otaliastudios.zoom.internal.matrix.MatrixController.setContainerSize$zoomlayout_release(MatrixController.kt:188) at com.otaliastudios.zoom.ZoomEngine.setContainerSize(ZoomEngine.kt:568) at com.otaliastudios.zoom.ZoomImageView.onSizeChanged(ZoomImageView.kt:111) at android.view.View.sizeChange(View.java:21007) at android.view.View.setFrame(View.java:20968) at android.widget.ImageView.setFrame(ImageView.java:1209) at android.view.View.layout(View.java:20828) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1654) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout(LinearLayout.java:1565) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1654) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1213) at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:899) at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:919) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout(LinearLayout.java:1565) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout(LinearLayout.java:1565) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:754) at android.view.View.layout(View.java:20831) at android.view.ViewGroup.layout(ViewGroup.java:6203) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2991) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2504) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1635) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7795) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1172) at android.view.Choreographer.doCallbacks(Choreographer.java:984) at android.view.Choreographer.doFrame(Choreographer.java:809) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1158) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

This issue doesn’t appear frequently and I don’t know why.

Thank you again for your work, and your support, Have a great day !

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
natario1commented, Jun 13, 2020

So just to be clear, it’s not like ZOOM or REAL_ZOOM is bad, but mixing the two is.

At the same time, both types are useful and it’s legit to want to mix them in some cases. For example I might want to use setMinZoom(1.0, ZOOM) to say that the image should not be zoomed out. And at the same time, use setMaxZoom(4.0, REAL_ZOOM), to make sure that the bitmap does not get too much pixelated.

But when one does so, he must be very careful with the size of the content/container and the transformation, because min > max can happen. In the above example, if the image is like 10x10, it must be zoomed a lot for the initial centering/transformation, so when you convert the min ZOOM (1.0) to REAL_ZOOM, you likely get something bigger than 4.0.

It’s an advanced use-case basically. For other usages I think setting a default value for type is a very good idea.

0reactions
markusresselcommented, Jun 26, 2020

@natario1 correct, thats probably a better way to describe it 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Time limits for Zoom Meetings
These time limits apply to meetings and webinars regardless of the device used to start the meeting (client, app, or phone).
Read more >
How To Change Default Minimum and Maximum Zoom Levels ...
Learn how to change default minimum and maximum zoom levels in Firefox. You can set maximum zoom more than 300% and minimum zoom...
Read more >
Is there a way to specify minimum and maximum zoom level ...
Instead of simply disabling the zoom, I would like the possibility to set its minimal and maximal boundaries under that, I have verified,...
Read more >
Layer Zoom Limits - OpenLayers
If min or max zoom are set, the layer will only be visible at zoom levels greater than the minZoom and less than...
Read more >
How to Set the Minimum and Maximum Zoom Level?
Furthermore, the maximum value of Google Maps Zoom level is 22. Therefore, the defined maximum value must be below or equal to 22,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found