These are chat archives for msalsbery/OpenSeadragonImaging

28th
Oct 2015
mdcorriveau
@mdcorriveau
Oct 28 2015 18:35
Hey guys, currently looking into msalsbery/OpenSeadragonImagingHelper#8
The problem is that the onOpen function don't get the current size for the current image
Is there any way in openseadragon to get the current object ?
Ian Gilman
@iangilman
Oct 28 2015 18:46
@mdcorriveau We don't know the current size until it's been properly opened. Once it has, you can access it via viewer.world.getItemAt(i).getContentSize() (if you're talking about the pixel dimensions of the image itself) viewer.world.getItemAt(i).getBounds().getSize() (if you're talking about its location in viewport coordinates)
To know when an image has been opened, you can listen for the world's add-item event, e.g. viewer.world.addHandler('add-item', myHandler)
mdcorriveau
@mdcorriveau
Oct 28 2015 18:53
Ok perfect @iangilman i'll look into that
Ian Gilman
@iangilman
Oct 28 2015 18:53
:)
mdcorriveau
@mdcorriveau
Oct 28 2015 18:54
in fact, i've just used those :P
this.imgWidth = this._viewer.world.getItemAt(App.pageIndex).getContentSize().x;
this.imgHeight = this._viewer.world.getItemAt(App.pageIndex).getContentSize().y;
I'm juste trying to figure out why it doesn't give me the right zoom level, currently debugging this :P
Ian Gilman
@iangilman
Oct 28 2015 18:54
Cool