question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best way to pass custom parameters to a dzi tile source?

See original GitHub issue

Let’s say this is my tile source:

const tileSource = new OpenSeadragon.DziTileSource({
  width: 19200,
  height: 19200,
  tileSize: 1023,
  tileOverlap: 1,
  tilesUrl: "http://localhost:4000/dzi_test/",
  fileFormat: "jpeg"
});

How would I go about passing custom args to the server, like “brightness” or “channels”, etc.?

Would I be able to attach custom args to every request (i.e. http://localhost:4000/dzi_test/12/1_0.jpeg?brightness=4&channels=blu,grn)

Alternatively, is there a way to pass custom headers with the request?

I realize there are many ways I could do this including using a custom tile source, but I am looking for the ideal/best way to accomplish this.

Thank you!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
palytoxincommented, Nov 27, 2020

sorry for that. I mean that it’s work not fine if I’ll changed tileSource = "http://localhost:4000/dzi_test/test.dzi?foo=bar1" to tileSource = "http://localhost:4000/dzi_test/test.dzi?foo=bar2"

but, I found a way to change it

  changeMode(mode: string) {
    const url = (this.viewer as any).tileSources;
    const bounds = this.viewer.viewport.getBounds();

    this.viewer.close();
    (this.viewer as any).open(url);
    setTimeout(() => { // waiting for viewer opend
      (this.viewer as any).source.queryParams = [`?mode=${mode}`];
      this.viewer.viewport.fitBounds(bounds, true);
    }, 500);
  }
1reaction
lk-jeffpeckcommented, Jul 3, 2019

Forget it. I just discovered that any args passed to the .dzi file will automatically be passed to the tile image requests. Easy. Great feature!

So, tileSource = "http://localhost:4000/dzi_test/test.dzi?foo=bar" will request images like http://localhost:4000/dzi_test/test_files/...jpg?foo=bar

That’s exactly what I need for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

openseadragon/openseadragon - Gitter
You could do it with a custom tile source (which might be good if that's how it's already implemented), or you could use...
Read more >
DZI Tile Source - OpenSeadragon
The DZI (Deep Zoom Image) format is an XML specification maintained by Microsoft and described here. OpenSeadragon supports the DZI format via AJAX...
Read more >
blocks:app-note:deepzoom [PIXILAB Wiki]
Here we pass the tileSource parameter set by the buttons. Multiple Spot Parameters can be passed along by listing their names, comma separated....
Read more >
browser - Gamma-correct zoomable image (dzi, etc) generator
tif and write pyr_name.dzi and pyr_name_files, a folder containing the tiles. You can use a .zip extension to the pyramid name and it'll ......
Read more >
changelog.txt
tileSize * Fix for IIPServer-style urls when using DZI (#413) * Fix memory ... the nav buttons (#376) * Added support for query...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found