-
-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error when opening a tiled image - highest zoom level could not be determined #2493
base: master
Are you sure you want to change the base?
Conversation
…oom level can not be determined
…oom level can not be determined
The change seems like a decent bit of defensive code, but before we go with it I'd like to know a little more about why this is happening. It looks like Also, with your fix, does everything seem to be working properly? Do you see any side effects? My concern is something else is going wrong that's causing Thank you for doing this! |
It looks like this could potentially happen if a negative number was given to one of |
i agree on your both comments. i investigated a bit more. Turn out that we are using the OSD api maybe a bit wrong. After opening an image we want to have the image displayed in fit to size, thats like the user is pressing the home button. As far as i can remember we had in the past some issues that this was not always working. Therefore we did the following:
The result is at the end a negativ zoom level and therefore the highest level in NaN. I am currently on it to run all our automated tests and check manually to check whether we can remove the zoomBy call. But maybe its also good to prevent the usage of zoomBy if the result is a negative value. What do you think about it? Does it make sense? @iangilman @pearcetm |
I agree that passing a negative number to Another question is why your image isn't filling the viewer after you call |
Yeah, the open call is asynchronous, so you need to wait until it's done before doing And yeah, some guards against making the zoom negative (or even 0) in |
In our configuration while loading a tiled image the following error was thrown. This happen when OSD was loading the first tiled image.
Reason for that is that the highest level could not be determinded (its NaN) in _updateLevelsForViewport that is calculated in _getLevelsInterval.
this.source
currentZeroRatio -564.8212461695608
this.minPixelRatio 0.5