Main LogoClients

IIPMooViewer - Ajax Client

This Ajax-based javascript client is compatible with Firefox / Mozilla (and other gecko-based browsers), Internet Explorer versions 6 & 7 and Safari. It is based on the Mootools javascript framework. To use, simply include the mootools.v1.1.js and iipmooviewer-1.0.js header files (there are also packed versions these files available in the distribution) in your header and create an IIP object:

<script type="text/javascript" src="javascript/mootools.v1.1.js"></script>
<script type="text/javascript" src="javascript/iipmooviewer-1.0.js"></script>

<script type="text/javascript"</script>

    // The iipsrv server full URL
    var server = '/fcgi-bin/iipsrv.fcgi';

    // The full image path on the server
    var fif = 'FIF=/path/to/image.tif';

    // Copyright or information message
    var credit = 'Copyright © or Information Message';

    // Create our viewer object - note: must assign this to the 'iip' variable
    iip = new IIP( "div_id", server, fif, credit );

</script>

You will also need to include the css file and image icons distributed. Then just create a minimal HTML page containing a div with the id given to the IIP instance:

 <body>
  <center>
   <div id="div_id"></div>
  </center>
 </body>

Note that the page must have a standard-compliant XHTML declaration at the beginning, but without the initial xml declaration. There is an example HTML page included in the IIPMooViewer distribution: just unpack the distribution, modify the server and image paths to get it working.

Note also that due to the Ajax security model, the IIP server must point to the same host as that from which your page has been served. If you want to host the IIP image server on a different machine, you will need to forward proxy requests to this other machine via your webserver. See the server page for more details on how to do this.

See the demo page to see the client in action.

JIIPImage Java Client

The client is written in Java and communicates directly with the server to request portions of the image at the desired resolution. It is able to efficiently cache image tiles and provies a very fast interface to the high resolution image.

Usage

The client can either be used as an applet embedded within a web page or as a standalone application. For applet use, the following parameters must be supplied:

<object classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=1,5,0,0"
        width="600" height="400" > 
<param name="type" value = "application/x-java-applet;version=1.5" />

  <param name="code" value="iipimage.jiipimage.JIIPView" /> 
  <param name="archive" value="jiip-view.jar" />  
  <param name="codebase" value="." /> 
  <param name="serverName" value="http://YOUR_SERVER_HERE/fcgi-bin/iipsrv.fcgi" />
  <param name="imageName" value="/YOUR/PATH/TO/IMAGES/image.tif" />

  <param name="cache" value="1000" />
  <comment>
    <embed
      type = "application/x-java-applet;version=1.5" \
      code = "iipimage.jiipimage.JIIPView" \
      archive = "jiip-view.jar" \

      codebase = "." \
      width = 600 \
      height = 400 \
      pluginspage = "http://java.sun.com/products/plugin/index.html#download">
      serverName = "http://YOUR_SERVER_HERE/fcgi-bin/iipsrv.fcgi" \

      imageName = "/YOUR/PATH/TO/IMAGES/image.tif" \
      cache = "1000" \
      <noembed>
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
        Your browser is completely ignoring the <APPLET> tag!

      </noembed>
    </embed>
  </comment>
</object>

Alternatively, the client can be used in standalone mode like this:

java JIIPView http://address/iipsrv.fcgi /path/image.tif

Dynamic JPEG Generation

It is also possible to embed links to dynamically generate JPEG images in a web page using the IIP protocol CVT=JPEG command to generate an image of the desired width. The FIF=image command specifies the absolute path to the image on the server machine and WID=width or HEI=height specify the width or height respectively. In the following example, a JPEG image of 400 pixels in width is generated from a source TIFF image located at /tmp/test.tif on the local server machine:

<a
href="http://127.0.0.1/fcgi-bin/iipsrv.fcgi?FIF=/tmp/test.tif&WID=400&CVT=JPEG">
Link
</a>

Alternatively, forms can be used to give the user some choice over the final image size and JPEG quality. In this case, simply create form inputs with the values for FIF, WID, QLT and CVT. For example:

<form action="http://127.0.0.1/fcgi-bin/iipsrv.fcgi" method="post">
 <input type="hidden" name="FIF" value="/tmp/test.tif" />
 <input type="text" name="WID" />
 <input type="text" name="QLT" />
 <input type="hidden" name="CVT" value="JPEG" />
</form>

A specific region of the image can also be specified via the RGN=left,top,width,height command where the left,top,width and height are defined as floating point numbers between 0 and 1. So, if you want the image to be the middle 50% of the image, use:

RGN=0.25,0.25,0.5,0.5

Old Javascript Client

A Javascript based client can also be used when Java is not available. Instead of requesting a series of image tiles, a combination of the IIP protocol CVT and RGN or JTL commands can be used to display complete image JPEG regions.

An example Javascript client is available on the demo page. To use it on your own site, modify the source and that of the linked javascript file (based on the cross-platform DHTML library by Walter Zorn). The image sizes specified in these files need to be customised as well as, of course, the image location and, if required, the page styling. This example client should work with most browsers and has been tested with Mozilla, Firefox and Internet Explorer (versions 5 onwards).