Add width and height properties for OpenSeadragon 6.0.0 compatibility#9
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds width and height fields to OMEZarrTileSource so OpenSeadragon 6’s ready-time dimension overwrite logic can read correct image dimensions from the tile source instance.
Changes:
- Introduce
widthandheightproperties onOMEZarrTileSource. - Populate
width/heightduringgetImageInfoonce array shape is known.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
21b38fd to
ad6e093
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In OpenSeadragon 6, on tilesource ready (https://github.com/openseadragon/openseadragon/blob/767c05aa98985ce1df24f6cc73cda49abd5b047f/src/tilesource.js#L162)
this.dimensionsis overwritten bysource.widthandsource.heightIn OSD5, there is no ready event handler that overwrites dimensions. The initialization logic (
this.dimensions = new $.Point(options.width, options.height)) only runs in the else branch, i.e., when there's no URL and configuration is inline. When a URL is provided, OSD 5 just sets safe defaults and calls getImageInfo, and whatever the subclass sets on this stays untouched.Simple fix is to add
widthandheightto the OMEZarrTileSource, but would be good to understand why it changed in OSD 6.