{"action":"created","issue":{"url":"https://api.github.com/repos/openseadragon/openseadragon/issues/1266","repository_url":"https://api.github.com/repos/openseadragon/openseadragon","labels_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/1266/labels{/name}","comments_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/1266/comments","events_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/1266/events","html_url":"https://github.com/openseadragon/openseadragon/issues/1266","id":245156121,"number":1266,"title":"Q: writing a custom tile source: imgix.com","user":{"login":"jrochkind","id":149304,"avatar_url":"https://avatars3.githubusercontent.com/u/149304?v=4","gravatar_id":"","url":"https://api.github.com/users/jrochkind","html_url":"https://github.com/jrochkind","followers_url":"https://api.github.com/users/jrochkind/followers","following_url":"https://api.github.com/users/jrochkind/following{/other_user}","gists_url":"https://api.github.com/users/jrochkind/gists{/gist_id}","starred_url":"https://api.github.com/users/jrochkind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrochkind/subscriptions","organizations_url":"https://api.github.com/users/jrochkind/orgs","repos_url":"https://api.github.com/users/jrochkind/repos","events_url":"https://api.github.com/users/jrochkind/events{/privacy}","received_events_url":"https://api.github.com/users/jrochkind/received_events","type":"User","site_admin":false},"labels":[{"id":26854975,"url":"https://api.github.com/repos/openseadragon/openseadragon/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-07-24T17:42:19Z","updated_at":"2017-08-01T12:25:47Z","closed_at":null,"body":"I'd like to try writing a custom tile source for imgix.com, commercial cloud-hosted image server. I don't know if imgix.com is really up to handling the kind of traffic that using it as a custom tile source will require (lots of requests for individual tiles), but I'd like to find out!\r\n\r\nimgix.com is an image server that allows you to ask for arbitrary regions and sizes from a source image. So in that sense, it's similar to IIIF servers (but with a different API), and the existing IIIF tile source. \r\n\r\nSo I'd start with the existing IIIF tile source, and change it's calls to be things imgix.com can handle. \r\n\r\nBut I wanted to check in first and see if you have any advice, if maybe the IIIF tile source doesn't use current best practices and there's somewhere better to work, or something I should take account of. \r\n\r\nIn my experiments with the IIIF tile source, it did seem to behave possibly somewhat oddly (or not what I expected) with regard to it's choices as to what tiles to fetch when. It seemed to me to fetch more tiles than it really needed. And to fetch every single level from must blurry through each level down until it gets to the one it actually wanted, which seems excessive to me. But I didn't actually compare this to older tile sources, and I don't know if this functionality is really inside the tile source itself or common between all tile sources. Just checking in for advice if you have it! \r\n\r\nIf I am successful and imgix.com seems up to it, I'll PR the tile source. "},"comment":{"url":"https://api.github.com/repos/openseadragon/openseadragon/issues/comments/319355237","html_url":"https://github.com/openseadragon/openseadragon/issues/1266#issuecomment-319355237","issue_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/1266","id":319355237,"user":{"login":"jrochkind","id":149304,"avatar_url":"https://avatars3.githubusercontent.com/u/149304?v=4","gravatar_id":"","url":"https://api.github.com/users/jrochkind","html_url":"https://github.com/jrochkind","followers_url":"https://api.github.com/users/jrochkind/followers","following_url":"https://api.github.com/users/jrochkind/following{/other_user}","gists_url":"https://api.github.com/users/jrochkind/gists{/gist_id}","starred_url":"https://api.github.com/users/jrochkind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrochkind/subscriptions","organizations_url":"https://api.github.com/users/jrochkind/orgs","repos_url":"https://api.github.com/users/jrochkind/repos","events_url":"https://api.github.com/users/jrochkind/events{/privacy}","received_events_url":"https://api.github.com/users/jrochkind/received_events","type":"User","site_admin":false},"created_at":"2017-08-01T12:25:47Z","updated_at":"2017-08-01T12:25:47Z","body":"Okay, I found the getImageInfo function, default in tilesource.js. \r\n\r\nSome inline comments suggest that a tile source can supply it's own custom getImageInfo. \"the extending class is expected to implement 'getImageInfo' and 'configure'\", \"in case the getImageInfo method is overriden\"\r\n\r\nBut this doesn't actually seem to be possible. I think getImageInfo on tilesource.js is called _before_ the particular tilesource implementation is identified, and an overridden getImageInfo is never called. The only existing tilesource that has an overridden getImageInfo is `imagetilesource.js`, but I believe it's overridden getImageInfo is never actually called in any circumstances, it's dead code. \r\n\r\nIf I need a custom source-specific method for fetching metadata (height and width) about an image, is there any way to do it? I'm not sure. \r\n\r\nI can't really reliably determine `supports` from the JSON returned by the appropriate getImageInfo-like response for imgix.  I really would like to trigger imgix by passing an object with `{type: 'imgix'}`, but still issue a getImageInfo external request to get height/width -- this also I can't figure out how to do, you seem to only get getImageInfo if you pass a string URL, no way to get it by passing an object.  Since it requires an async request with callbacks, it's difficult to duplicate on my own, and looks like it's not appropriate to call it _twice_, since the first will call `raiseEvent( 'ready'` itself. \r\n\r\nIf this makes sense, any advice appreciated. "}}
{"actor":{"display_login":"jrochkind"}}