These are chat archives for openseadragon/openseadragon

18th
Aug 2017
John
@jp887
Aug 18 2017 07:08
@iangilman Thanks for that. Thats just what I needed :smile: My app is also running in a specific environment where I have plenty of memory to play with. Is there a way to have Openseadragon preload/cache the tiles so I can make full use of the available memory? I do some long distance panning operations and this causes low quality tiles to be shown as the tiles cannot load from disk as fast as panning occurs. Thanks.
Ian Gilman
@iangilman
Aug 18 2017 16:34
@jp887 We don't really have a mechanism for pre-loading arbitrary tiles... basically you have to expose whatever part of the image you want loaded.
Does your environment also allow for a lengthy pre-load time? One option would be to navigate along those paths in a hidden state before you present the piece
You'll probably want to make the maxImageCacheCount option bigger (it defaults to 200)
Another option might be to work with the TileCache directly
Anyway, I'm happy to help you figure out the best strategy...
John
@jp887
Aug 18 2017 17:50
@iangilman thank you for the help! My environment does allow a lengthy load time so pre-caching time is not much of a concern. If I navigate the paths ahead of time to warm the cache would I need to use the same pan speed or could I speed up the panning and reduce the load time? If working with the TileCache might lead to a reusable solution I'd be happy to contribute back to OSD if you think others might find it useful.
Ian Gilman
@iangilman
Aug 18 2017 17:54
I'm not sure what the speed would have to be... you have to be on a position long enough to trigger a tile load, and I'm not sure if moving off too soon would cancel the tile. You'll probably have to do some experimenting and watching the behavior.
The most conservative approach would be to move to a specific point on the path and then wait for the fully-loaded-change event, then move to the next point in the path, etc.
...but you might be able to move quicker; it's just not an area I can say for sure off the top of my head
To use TileCache instead, you'd have to do the math to figure out which tiles you needed.
Though I suppose if it's always the same path you're trying to pre-load, you could rig up something to follow that path and capture the list of tiles which you could then save and feed into the TileCache for future runs of the app
If you went that route it's not just the tile cache you're dealing with but also the tile loader... you'll probably need to replicate what TiledImage does here: https://github.com/openseadragon/openseadragon/blob/master/src/tiledimage.js#L1435
John
@jp887
Aug 18 2017 18:40
I'm wondering also what the effect of changing the tile sizes and/or number of levels in the image pyramid would be on this. Perhaps fewer images/larger tiles would mean less time needed to be spent passing over to trigger loading all the tiles. Or perhaps another option would be to pre-load everything down to a certain level in the pyramid. Thinking aloud here...
Ian Gilman
@iangilman
Aug 18 2017 18:51
Indeed... you're probably better off with bigger tiles... maybe 1024
...and preloading entire levels certainly would be another approach
John
@jp887
Aug 18 2017 19:04
Would preloading more than one entire layer be redundant? i.e. at that point are the upper layers of the pyramid even needed?
Ian Gilman
@iangilman
Aug 18 2017 20:18
I assume by upper layers you mean the low resolution tiles? No, you're right, once you load an entire high res layer, you don't really need the low res layers.
I assume you're not talking about loading the very highest res layer, since maybe there's no advantage to tiling the image at all if you do that
...though maybe there still is, depending on how big the image is
Anyway, loading all of the tiles for the second-most high res layer might work well