Adding Seadragon, a High Quality Image Viewer, to phpBB3
Microsoft Labs has developed a Silverlight-based web application called Seadragon which is used to make viewing large images more practical. Panoramic and other high quality images can have you scrolling all over so that you may not be able to see the whole picture or if the image is resampled down, you lose a lot of the detail. Seadragon provides an interface that allows you to interact with the photo so that you can both see the big picture and then zoom in to see the detail. I originally heard about Seadragon through a post over at Freewaregenius and I wanted to take the information to the practical level by showing how to use Seadragon inside a phpBB 3 forum to add the ability to handle large images.
Seadragon allows you to zoom in, zoom out, center to the original position and manipulate the image in a full screen mode through your mouse’s scroll wheel or buttons found over the image as you hover over. It can be embedded in a website using simple code that it provides to you like this:
<script src="http://seadragon.com/embed/dm1.js?width=auto&height=400px"></script> |
To result in something like this:
(The credit for the image I used and more amazing photos belong to Brad Templeton’s Photography.)
To create a Seadragon object, we just visit www.seadragon.com/create/, enter the URL to an image we want to use, and then hit the Create button.
The next page you’re taken to will include a Seadragon object of your image if it was able to connect to the file correctly and was of either jpeg, png, or tiff file types. Below the object, there is a link you can use to send people to this viewing page. The last part of the URL works much like a URL shortening service, a unique code is assigned to your image so people can easily get back to it. In this case, my image is coded: dm1. Below the URL, you are provided Embed code which very easily could be used on a website that accepts HTML.
PhpBB does not accept HTML, but by creating a Seadragon BBCode, we can safely allow visitors of our forum to conveniently and impressively add large, high resolution, interactive photos. To add a BBCode to your forum, log into your Administration Control Panel and then navigate to the Posting tab. Under the Posting tab, BBCodes shows up by default; if not, just select BBCodes from the left navigation column. Click the ‘Add new BBCode’ button at the bottom right of the page to go to the BBCode editing page. In the first box, for Usage, add the line:
[seadragon]{TEXT}[/seadragon]
For HTML replacement, add this line:
<script src="http://seadragon.com/embed/{TEXT}.js?width=600px&height=500px"></script> |
The Help line and whether you want it to be displayed on the posting page can be configured as you prefer.
The only requirement for Seadragon is a modern browser with the Silverlight plug-in installed. If you have those, you’ll be able to see something like this in your phpBB forum by just using the simple BBCode [seadragon]dm1[/seadragon]. That’s the code that is generated when you create a Seadragon object just wrapped with the [seadragon] BBCode.
Seadragon allows you to get to the original file, so it cannot be used as a means to protect your image copyright. If you visit the view page for an image at Seadragon, you’ll notice a link to View Original below the image that links back to the original file. The images are not private, while there is no means to just browse through the archives, you can manually visit any image code by just typing in /view/1 on up to /view/999 and then to /view/a0 and /view/dve. Some of the cool ones I’ve found include:
Some wishlist and other things I wanted to mention:
- Even unsuccessful attempts to generate an image creates a record and takes up a code. For continuity and browsing, it seems wasteful to do that.
- Using images from this gallery, I tested to see if Seadragon supported JPEG 2000 images. It doesn’t.
- If you connect to your forum using an https connection, the Seadragon object appears, but the image doesn’t load.
- You can’t use an attachment in phpBB to generate a Seadragon object because of the page that phpBB uses, /file.php?259 doesn’t get detected as an image.
If you want to see Seadragon in action in a phpBB forum, check out the demo in the comments.
Comment on this post in our forums
Related posts:







October 19th, 2009 at 6:59 AM
[seadragon]dm1[/seadragon]October 19th, 2009 at 8:40 AM
I like the logo, but it seems pretty buggy. I full screened it and it never finished loading. Attempting to zoom in too far yielded the same results.
October 19th, 2009 at 8:43 AM
On IE6?
And what version of Silverlight do you have installed? (This page should tell you: http://www.microsoft.com/silverlight/get-started/install/default.aspx)
October 19th, 2009 at 9:41 AM
Hmmm, I may not even have silverlight installed. Not sure it’s one of the things they’ll let me install, let’s see….
October 19th, 2009 at 10:09 AM
It’s often treated as a Windows Update, so it might be in there.
October 20th, 2009 at 10:54 AM
I went out and grabbed a pretty large jpeg image (16000×16000 pixels) and was impressed with how fast it converted it (about 2 seconds) and I immediately started zooming and panning with no hitches. I tried it in all the latest version of my five main browser, and they all handled it adequately. IE8 and FF 3.5 seemed to handle it pretty smoothly (maybe IE8 was a little smoother) and then Opera, Safari, and Chrome all handled it, but had a little stutter on zoom and pan. It seems odd that it can’t ingest jpeg2000 files yet. My brief scan of the web for info on this indicates that this is already leverages a part of the jpeg2000 format to make this work…
Tried to upload this jpeg2000 image I created in PS CS4 and it seems to stall out (after warning me that the file doesn’t appear to be an image because it didn’t have a .jpg or .png extension). Then it finally reported "We couldn’t find an image at that URL. Please make sure the URL points directly to an image file and not to a page that contains one. Change the URL or try again?"
I do love that it supports using the scroll wheel for zooming in and out!
October 20th, 2009 at 12:37 PM
Wow that is a pretty hefty image there.
And you can embed it here too!