Fix: setting new source, which is the same as the old source
Hi there,
In a project we're doing, it may happen that the same MultiScaleImage.source is set again, the image disappears. I have made a small modification to MultiScaleImage, which I would like to share here in case anyone else runs into this problem.
In case you cant use the patch further down, just search for the lines
and move them down, AFTER THE BLOCK (not inside) of "if (value is String) {...}"
This patch alters the position of the removal of the "old" image in the container. Currently it is done before the equality-check. This leaves the user with a blank screen in case you set the same URL again.
In a project we're doing, it may happen that the same MultiScaleImage.source is set again, the image disappears. I have made a small modification to MultiScaleImage, which I would like to share here in case anyone else runs into this problem.
In case you cant use the patch further down, just search for the lines
if (_source)
{
_source = null
container.removeChildAt(0)
viewport.showAll(true)
}
and move them down, AFTER THE BLOCK (not inside) of "if (value is String) {...}"
This patch alters the position of the removal of the "old" image in the container. Currently it is done before the equality-check. This leaves the user with a blank screen in case you set the same URL again.
diff MultiScaleImage.as.0.4.2 MultiScaleImage.as
142,148d141
< if (_source)
< {
< _source = null
< container.removeChildAt(0)
< viewport.showAll(true)
< }
<
151,152c144,146
< if (String(value) === url)
< return
---
> if (String(value) === url) {
> return;
> }
171a166,172
> if (_source)
> {
> _source = null
> container.removeChildAt(0)
> viewport.showAll(true)
> }
>
1
person has this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
The company marked this problem solved.
-
Inappropriate?Claudius,
Thanks for reporting this bug and proposing a fix. I've actually fixed the bug and also did some minor refactorings to the code:
http://github.com/openzoom/sdk/commit...
Would you mind updating your SDK to the latest version and give it a try?
Cheers,
Daniel
I’m thankful
The company says
this solves the problem
-
Inappropriate?Hi,
I think, there may be a misunderstanding, I currently have an image, which is 4000x3000px in size, if I view it at what I consider to be 100% scale, the MultiScaleImage.scale property reads 0.249.. (see screenshot)

The image was converted with the deepzoom.py-library.
I’m unsure
-
Inappropriate?Claudius,
Wow, weird! Was this introduced by the latest changes I checked in or did you mean to post this as part of the Photoshop-style zoom property topic?
Could you zip up the example and send me a link so I can have a look at it?
–Daniel
I’m like «oops»
Loading Profile...




EMPLOYEE