Bug in full page mode crashes seadragon, requires page reload
With very specific zoom, picture size and container sizes, going to full page mode gives an empty screen and seadragon never comes back (I can switch back to regular mode, but visualization is gone). Suddenly full page mode started doing this for me, it was very strange. After wasting too much time on this, it seems that seadragon doesn't like particular zoom, picture size and container sizes. Below's the basic code that reproduces this problem. In navigateTo, if I multiply zoom by 1.0001 or 0.9999, everything's perfect... I'm guessing this has to do with dividing by a power of 2 the full width of the image? But then I change the container width slightly (904 to 894) and that makes everything work too. Let me know if the actual test image files are needed. This is a pretty major issue for me of course, I can't go live without this fixed. Oh, there are no errors in firefox or safari. IE7 gives an error, but I'm not sure it has to do with this, I don't have access to IE7 at the moment. Seadragon crashes with the below on ALL browsers. Lastly, the below crashes if I don't zoom at all or I zoom in and then go to full page. However, if I zoom OUT even a tiny bit and then go to full page, it works perfect.
<!DOCTYPE html SYSTEM>
<html>
<head>
<image><size height="1400" width="92790" /></image>');
}
function onViewerResize(viewer) {
if (viewer.isFullPage()) {
alert("fullpage");
}
}
function onOpen() {
var zoomInteractiveThreshold = 0.125 * 92790 / viewer.viewport.getContainerSize().x;
navigateTo(0.931091712469016, 0.003771958185149262, zoomInteractiveThreshold/2);
}
function navigateTo(x, y, zoom) {
viewer.viewport.panTo(new Seadragon.Point(x, y), false);
viewer.viewport.zoomTo(zoom, null, false);
//viewer.viewport.zoomTo(12.830475663716815, null, false);
}
Seadragon.Utils.addEvent(window, "load", init);
<style type="text/css">
#container
{
width: 904px;
height: 357px;
background-color: black;
border: 1px solid black;
color: white; /* for error messages, etc. */
}
</style>
</head>
<body>
</body>
</html>
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?getsatisfaction changed my seadragon init code... The code they replaced it with was:
<image><size height="1400" width="92790"></size></image>');
}
That SHOULD'VE looked like this:
&script type="text/javascript" src="http://seadragon.com/ajax/0.8/seadragon-min.js">
&script type="text/javascript">
var viewer = null;
function init() {
viewer = new Seadragon.Viewer("container");
viewer.addEventListener("open", onOpen);
viewer.addEventListener("resize", onViewerResize);
viewer.openDzi("http://localhost:8080/test/images/tree_5.xml", '&Image TileSize="256" Overlap="1" Format="jpg" xmlns="http://schemas.microsoft.com/deepzoom/2008"><size height="1400" width="92790">');
}
</size> -
Inappropriate?Well I don't know how to post it well here. Go to http://jsbin.com/awoho and view source (google analytics is inserted by jsbin, the problem happens whether it's in there or not).
-
Inappropriate?Hey Scott,
Thanks for getting a useful repro for this bug. Unfortunately, I'm not able to see it in action because it likes the site you link to uses an image from your computer directly:
viewer.openDzi("http://localhost:8080/test/images/tree_5.xml", ...);
So I'm not able to see the image since I'm not on your computer. Any chance you could upload the image somewhere? (You can upload just the source image if you like, I can convert it to DZI here.)
Alternately, if you have a web server running on your machine, just replace "localhost" with your IP address and it should work. (Just make sure to make a firewall exception for the web server if necessary. I can help with that if you need.)
Aseem -
Inappropriate?Aseem, thanks so much for the quick response. I'm actually at a conference on my laptop, so I was hoping you could figure it out without the images. But I guess they're pretty important :). I'll upload them somewhere now.
-
Inappropriate?ok, finally, am able to transfer the tree_5_files directory to www.fightgame.com (http://www.fightgame.com/tree_5_files). It kept crashing cyberduck, so I downloaded filezilla and it has 2000 images left to upload... maybe another 5 minutes it should be done.
-
Inappropriate?you can fully view the code and problem now at www.fightgame.com/seatest.html
-
Inappropriate?Ah, this is the dreaded "NaN bug" that our tester found and we've been putting off investigating. The image disappears because somehow, the viewport's center (x, y) becomes (NaN, NaN).
Thanks for uploading the images, Scott. I'll look into this over the weekend and hopefully can get you a fix/workaround ASAP! -
Inappropriate?Thanks Aseem, I appreciate you working on this over the weekend. Let me know what I can do to help.
-
Inappropriate?Just a quick point, you mentioned the problem is when, somehow, the viewport's center (x, y) becomes (NaN, NaN). This problem happens on specific zoomTo values regardless of what I set in viewer.viewport.panTo(), if that helps...
-
Inappropriate?Scott,
I found the cause! After some painstaking debugging, it turns out precision error is the problem. Take a look at this debug snapshot from your site:
zoom 6.41523783185841 Number
self.getZoom() 6.41523783185841 Number
zoom == self.getZoom() false Boolean
zoom - self.getZoom() 8.881784197001252e-16 Number
Those two values should be equal, but a precision error makes them unequal. This causes a missed equals case and ends up causing a divide by 0 later down the line!
So I've added a redundant check with another value, which seems to fix the problem for your website. I'll try to validate my fix against one other case we found, and if it looks good, I'll push the fix out to seadragon.com as soon as I can. =)
Thanks for your repro! This hopefully puts to rest this rare-but-fatal bug.
Aseem
I’m relieved
-
Inappropriate?Excellent, I can't wait to try it! One thing a little strange is that I run into this problem a lot lately even though my visualization changes in size quite a bit. Though I can't reproduce this with the sample visualizations on the seadragon site.
I’m thankful
-
Inappropriate?Scott,
Very sorry for the delay. We've all been swamped with other projects and our tester hasn't had the cycles to sign off on the fix. I'm helping him get some repro cases and we're seriously aiming to get this and other fixes out by the end of the week. Thanks for your patience!
Aseem -
Inappropriate?Hi Aseem, thanks for following up. I'm anxious to get this fix. For whatever reason it happens very frequently with my application.
-
Inappropriate?Hey Scott,
Again, apologies for the delay. We're really almost there. =) The fix is ready to go and staged for release; our tester has validated our new version (which contains other fixes as well) almost fully. Things have just been busy around here because of some Silverlight milestones, so the process has been a bit slow. Again, apologies, and really thanks for your patience. I'll be the first to post here as soon as we release the fix!
Aseem
I’m pained that we haven't been able to help you quickly, but excited to get these fixes out!
-
Inappropriate?I'm excited for the update!
-
Inappropriate?Hey Scott,
As you saw, we (finally) deployed the fixes today. I'm glad we were able to help you, but please accept my apologies for the long delay. Either way, let us know if you run into any other problems.
I'm really looking forward to seeing this visualization of yours! Don't forget to post when it's available. =)
Aseem
-
Inappropriate?sorry for the late thank you response... everything looks good now! My app is ready right now, but I'd rather wait to give you the URL until my redesign is finished this coming week :).
Loading Profile...



EMPLOYEE