How should I cleanly use the or viewer in combination with my own DZI?

  • 1
  • Question
  • Updated 10 years ago
  • Answered
I'd like to use either the or viewer with my own self hosted DZIs and I'm wondering what the best way to do that is.

When I glanced at the Javascript file that the embed code uses, the URL to the DZI is right at the end of the file, so presumably if I copy the file to my own server, replace that DZI URL and properties (resolution, tile resolution, etc.) with my own, and take care to repair any relative URLs, presumably everything would work. The obvious downside is that this means that if you update the viewer JS or XAP files on your end, my static file on my own server will become immediately antiquated.

The obvious question, given Bing's devouring of Live Labs, is how long the versions of the viewer files that you're hosting are going to be around.

The reason that I ask all of this is that I am about to suggest that a new photogrammetry forum, which is just starting up, enable the viewer as a piece of custom bulletin board code. That is to say, since users are dissallowed to post HTML (and presumably Javascript) for the security of the board, there have been custom bulletin board tags created for Photosynths, PhotoCity point clouds, Vimeo and YouTube videos, etc., such as [photosynth]insert collection id here[/photosynth] which insert the correct parameter into the default HTML embed code for particular services and I would like to suggest that they implement the same for DZIs, as I would love to use them for illustrations (and the expansion of the use and awareness of the Seadragon format on the web). The big selling point of pointing to your sites' embed code for me is the progressive enhancement of Seajax to Silverlight, ensuring that everyone should be able to view my illustrations.

Ideally, I would like to have one single simple solution like:
[zoom]insert ID or DZI URL here[/zoom].

It should be simplicity itself to get images working, but custom URLs to other DZIs are more tricky as they would require copying and modifying the Javascript file from a random image, overwriting the DZI URL, and then saving a static copy of the .js file on their servers - just waiting to be out of date. I suppose that the board could dynamically create the JS file each and every time that the page was loaded, but that feels a little crazy to me.

It would be a lot simpler for me if I could just take the URL to the .DZI or .XML which is residing on my server and plug it into or and get back a normal new ID number (which will generate a normally named .js file on your servers which refers to the .DZI on my server, rather than one on yours) which could be placed inside the BB Code as is, so this is really something of a feature request.

If that is something which you don't want to do from a design perspective or simply do not have time to implement, given current circumstances, then what do you suggest for me? I need something simple to suggest to the admin. Having him write something which determines whether a simple ID number has been placed within the BB Code tag or whether it is a full URL to an external DZI, fetching the .js file to modify and store, is much less appealing. I really really miss the functionality of the Seadragon AJAX page which built embed code for a DZI wherever it already was on the web and I've missed it from the launch of

The other solution is simply to settle for a particular build of Seadragon AJAX and the corresponding XAP, host them ourselves, and have BB Code ready to trigger a little server side script to parse the DZI URL out of a or URL or, alternately, accept any other DZI URL from the web.
Photo of Nathanael Lawrence

Nathanael Lawrence

  • 795 Posts
  • 55 Reply Likes
  • lost.

Posted 10 years ago

  • 1
Photo of Aseem Kishore

Aseem Kishore, Former Employee

  • 702 Posts
  • 124 Reply Likes
Official Response
Hey Nathanael,

Sorry for the delay in responding here! As you can imagine, these last couple of weeks have been hectic, hectic, hectic. So thanks for your patience. =)

It's great to hear what you're doing! That's really awesome and it's great for spreading the Deep Zoom / multi-res awareness. =)

As you've likely heard by now, the great news is that is staying up! Many people around the company saw value in it, and the Silverlight team offered to continue to host and maintain it. So for the foreseeable future, you can count on embeds and related assets sticking around.

So right off the bat, I'd say that's the best solution for content -- just use the embeds directly.

&lt;script src="<a href="" target="_blank">http&#058;//zoom&#046;it/<strong>11mb</strong>.js?width=auto&height=400px</a>"&gt;&lt;/script&gt;

As for DZIs, you're absolutely right that should support them, and that we've had a gap in our story since we took down that "embed builder" for Seadragon Ajax.

But the good news is, this has never really been much of an issue in practice -- almost everyone prefers the simplicity of over the hassles involved in creating and uploading your own DZI somewhere. I wonder if this will be especially true for photography, where you really just want to show your photo -- you're not making a complex Deep Zoom composition (AKA sparse image).

So if you're willing to give it a shot initially without DZI support, you have a full and easy solution. What do you think? =)

If you still want DZI support, I have some ideas and a reasonable workaround for now, but it does complicate the simplicity a little bit, so I'm inclined to say "keep it simple" for now.

Hope this helps!
Photo of Aseem Kishore

Aseem Kishore, Former Employee

  • 702 Posts
  • 124 Reply Likes
Official Response
Nathanael, thanks for your patience! I didn't forget about this, and wanted to answer some of your questions and offer the workaround I mentioned.


"One alternative to getting a combo embed builder for stray DZIs would be to get Deep Zoom Composer to publish all Seadragon AJAX projects with the combo viewer, rather than only Seajax."

Good news -- it already does! ;) We didn't announce it when we shipped this update, but we did update Deep Zoom Composer's "Seadragon Ajax" output option -- now named just "Seadragon" -- to spit out both a library.html that uses the Seadragon Ajax library and an embed.html that uses the Seadragon Combo Embed. Just upgrade to the latest version if you don't see this.

So as you can guess, my workaround involves simply using this combo embed for the cases where you have a DZI URL. The syntax is identical to the old Seadragon Ajax embed; only the URL has changed slightly:

&lt;script src="http&#058;//seadragon&#046;com/combo/embed.js"&gt;&lt;/script&gt;
Seadragon.Config.proxyUrl = "path/to/proxy.php?url=";
Seadragon.embed("auto", "400px", "path/to/my.dzi");

As with the old Seadragon Ajax embed, this works out-of-the-box if your DZI is on the same domain as the page showing it. If it's on a different domain, add the extra width, height, tileSize, tileOverlap, tileFormat and displayRect parameters as before. (Let me know if you need help with this.)

<edit> I realized that (a) cross-domain will be a major scenario for any forum, and (b) it's actually much easier to work around that with a server-side proxy in this case than through manually parsing the DZI and getting that info out. So the one requirement is to have a simple proxy on the server (sample PHP code) and tell Seadragon to use it. Then it should "just work". =) </edit>

This should solve your scenario! =) The only difference will be that this one will show the old-style buttons and the Seadragon logo, while the viewer will of course show the new-style buttons and the logo. The behavior otherwise will be identical. Hopefully that's okay for now.


"It honestly comes down to wanting simplicity. I don't want to have to request two different tags for the same format and hopefully the same viewer. [...] I'd like that same consolidation for DZIs. My primary desire is simplicity for the people who will be embedding media."

This all goes back to what we both completely agree on -- should support DZI URLs. I can't emphasize enough that I agree that this should happen. =) I'm just saying that it never became a priority for us, because no one ever asked for that. (The only use case now for Deep Zoom Composer now -- besides collections which aren't viewable yet in anyway -- is sparse images, as you mention.)


"One last question before I sign off: What are the plans for the current site? For the moment, I'm asking because I'm sentimentally attached to the Seadragon logo being in the lower left corner of the viewer, rather than the Deep Zoom logo (no disrespect intended). [...] Is the message of how to create one's own zoomable embed (when the logo is clicked) always displayed with AJAX, even if the Silverlight viewer is being used?"

These are really several questions! ;)

We haven't formally announced this yet, but we intend to keep up going forward for the foreseeable future, specifically in order to not break all the sites out there that use the hosted version of Seadragon Ajax or our various embeds -- including this combo embed used by Deep Zoom Composer. So while the rest of will be replaced by redirects, certain static resources like these will remain.

As I mentioned above, the combo embed shows the Seadragon logo, so that's not a problem in your case. =) I would recommend using the logo for the embed, though. While the Seadragon logo has sentimental value to both you and me, the logo is the more actionable and available brand right now and going forward -- especially given that the Silverlight team is interested in continuing to evolve the service!

That said, it's indeed not easy to replace the logo -- or the "about" message when you click it -- because it is indeed duplicated in both Ajax and Silverlight. (To answer your question directly, no, Ajax is not used for the message when the viewer is Silverlight.) The technical reasoning for this is that the Silverlight plugin has to be windowed in order to get the best visual performance, and that prevents overlaying Ajax content, so we had to duplicate all of the UI.


I hope all of this helps and answers your questions! =)