Zoomable web images
iZoomr chops these images into cells of a fixed size. Currently I use 256x256 but this, too, can be changed in the code.
Finally, iZoomr stores the images on a server as well as metadata information describing the image cells, the corresponding resolution image that they belong to, as well as the original image data.
<embed src="zoomr.swf" quality="high" bgcolor="#0c0c0c"
width="WIDTH" height="HEIGHT" name="zoomr"
allowFullScreen="true"
type="application/x-shockwave-flash" flashvars="zid=ZID&base=BASEURL"/>
This embed tag contains four items that you need to replace:
<?xml version="1.0" encoding="UTF-8"?> <image width="792" height="1728"> <resolution src="32.xml" size="32" sx="0.018518518518519" sy="0.018518518518519" /> <resolution src="64.xml" size="64" sx="0.037037037037037" sy="0.037037037037037" /> <resolution src="128.xml" size="128" sx="0.074074074074074" sy="0.074074074074074" /> <resolution src="256.xml" size="256" sx="0.14814814814815" sy="0.14814814814815" /> <resolution src="512.xml" size="512" sx="0.2962962962963" sy="0.2962962962963" /> <resolution src="1024.xml" size="1024" sx="0.59259259259259" sy="0.59259259259259" /> <resolution src="2048.xml" size="2048" sx="1" sy="1" /> </image>
<?xml version="1.0" encoding="UTF-8"?> <grid resolution="512" width="792" height="1728" sx="0.2962962962963" sy="0.2962962962963"> <cell src="i_512_0.jpg" u0="0" v0="0" u1="792" v1="864"/> <cell src="i_512_1.jpg" u0="0" v0="860" u1="792" v1="1724"/> <cell src="i_512_2.jpg" u0="0" v0="1720" u1="792" v1="1728"/> </grid>A resolution is described as a "grid" in XML. Each grid specifies its resolution, here as 512x512 pixels. It also specifies the original width and height of the image, here seen as 792x1798 pixels. In addition it specifies how much the X dimension has been scaled (sx) as well as the Y dimension (sy) from the original image.
A grid consists of several cells. Each cell has a source image, src, that is assumed to be relative to the pathname ZID. Each cell also specifies the upper left and lower right coordinates of the cell in (u,v) space. In this space, (0,0) corresponds to the upper left of the source image. The space extends the entire width (w) and height of the source image, in pixels.
The upper left is specified as (u0,v0) and the lower right is (u1,v1) for every cell. This allows for you to experiment with different tesselations, or ways to chop up an image.
Resolution 512x512, (0,860) to (792,1724)
Resolution 4096x4096, (756,756) to (1012,1012)