-
-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading docs and overly complex tilesource deduction. #2474
Comments
I leave it here as a docs for later, RN I have no cappacity to fix this. |
Okay found one more bug: if you pass object (scenario 3b) and override |
Yes, this has become a total mess! Thank you for writing up the issue. I figure (when we have the bandwidth to look at this) we should define a nice clean extensible system and move to that by default, but somehow provide a deprecated version of the old system for a while for backwards compatibility. |
One more issue to add (so I won't forget): The parent implementation of
However, if I write custom
Wrapping the execution of |
Thank you for documenting these weirdnesses! |
One more thing that could be improved, not necessarily a bug. TileSource ignores any child implementation logics when a string is provided - fetching image info is done solely on the parent class implementation, which is problematic for example with tokens. You cannot simply give OSD auth headers with a token, since token expires and it has to be fresh. But doing so within the TileSource child implementation is impossible when created via URL string, since it is not instantiated before it tries to access the image metadata, which is where the token is already needed. My use-case requires me to specify this logics in the TileSource child, which means forcing users passing an object instead of an URL string... |
Following up on the above: if you do this (e.g. provide a custom object configuration, override
|
I am thinking about refactoring the tile source creation, since it is so intricate even the docs are wrong, see
openseadragon/src/tilesource.js
Line 58 in 59645e3
I try to sum up the current behavior:
There are three scenarios of opening a tile source:
TileSource
instance is created and it is ensured its argumenturl
is set so thatgetImageInfo()
gets called, which creates new tile source search based on retrieved data from the url string and calls againconfigure
a) if it defines
getTileUrl
property, it is considered a TileSource inline implementation and passed to newTileSource
instancewhere it again decides if
url
property is specified it goes to 2) else it expects other properties set (width, height...) explicitlyb) else we rely on
determineType
that callssupports
with null url, and data=inline object on the first compatibleimplementation (
supports(..)=true
) and we continue withconfigure
call.Now:
getImageInfo
can be overriden, which is true only in 3b) case, otherwise the parent method is always usedclass
sugar) and provideurl
inside the options objectTileSource.url
looks like value we would like to set manually, in reality this will create infinite loop ifconfigure
and then call super constructor - which is done in most cases and becomes compulsory withclass
sugargetTileUrl
that also definesurl
prop you immediatelly exit withsuccessCallback( customTileSource );
whereas 2) would wait for success callback fromTileSource
base class - but both would fire the same process... okay it ends up as no-op but a different tile source is created and finally thrown awaysupports()
behaves, it has either data+url passed in casegetImageInfo
parent method gets executed, or [inline object]+null if inline object withoutgetTileUrl
is provided which was not clear to me at all, looks like another hack to allow plain tile image source configuration based ontype
property, which should be either standardized somehow, or done differently, I just don't like the option of passing a generic object withoutgetTileUrl
implementation that somehow relies on tilesource private level information/logicthis
insideconfigure
is either reference toviewer
or (some maybe irrelevant)tileSource
, which is not documented anywheregetImageInfo
that communicates with some infrastructure that provide multiple image servers with the same protocol but different configuration (e.g. authenticated VS public access, system-managed data records VS file heap etc..)It took me one hour to figure this out, and I thought I knew the pipeline quite well. My motivation was the last point and the case I was looking into more advanced custom tile source integration.
The text was updated successfully, but these errors were encountered: