Loading Your DZI

Loading the DZI file into your OpenSeadragon viewer

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

This lesson preview is part of the OpenSeadragon Deep Dive course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to OpenSeadragon Deep Dive, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course OpenSeadragon Deep Dive
  • [00:00 - 00:05] In the previous lesson, you made a DZI file. In this lesson, you'll load it into the viewer you started in the previous module.

    [00:06 - 00:12] This means it's time to start using a local web server rather than just loading your HTML file into the browser. We'll go over that as well.

    [00:13 - 00:22] First, you'll want to make sure the DZI file and its folder are next to your other files like so. Then, you'll want to change the tileSources option of your OpenSeadragon viewer .

    [00:23 - 00:34] In this case, instead of giving it an object like before, you can just give it the URL to your DZI file like so. You can keep the collection mode and collection rows from module 0 lesson 2.

    [00:35 - 00:45] They won't have any effect because it's a single image. If you try running it like before, where you just load it directly into your browser, you'll find you get an error, unable to load tile source.

    [00:46 - 00:54] This is because the browser doesn't want to let you open the DZI file directly for security reasons. Instead, we need to actually start up a local server.

    [00:55 - 01:09] There are a number of ways to do this, but the simplest way on Mac or Linux is to use Python server since Python is already installed on those OS's to begin with. If you're on Mac or Linux or have Python installed on your Windows computer, open a terminal in your project directory.

    [01:10 - 01:17] If your system has Python 2, use this command. If your system has Python 3, use this command.

    [01:18 - 01:28] If you're on Windows and don't have Python installed, I have a number of other suggestions in the text of this lesson. Then, you can open your page by going to http://localhost:8888 in your browser.

    [01:29 - 01:34] Once you have it running, it should look like this. You now have a local server running.

    [01:35 - 01:39] Hopefully that wasn't too much trouble. It'll serve you well in the upcoming lessons.

    [01:40 - 01:43] For the next lesson, we're going to continue creating DZIs, but now with a script to automate