Get your own customer support community

Recent activity

Subscribe to this feed
  • question
  • question

    Ruven replied on February 17, 2010 18:38 to the question "OpenZoom and IIPImage" in OpenZoom:

    Ruven
    Hi Daniel,

    I've added some simple parsing to your IIPImageDescriptor class to automatically get this from the server:



    /**
    * Create descriptor from basic info returned by IIP server.
    * The response is of the form:
    * Max-size:4080 3072
    * Resolution-number:5
    * etc...
    * We only need the image size and tile size for now
    */
    public static function fromBasicInfo(metadata:String, image:String, server:String=DEFAULT_SERVER):IIPImageDescriptor
    {

    var matches:Array = new Array()

    // Max-size response
    var width:uint
    var height:uint
    matches = metadata.match(/.*(Max-size:)([0-9\.]+) ([0-9\.]+)/)
    if(matches==null) return null
    if(matches.length>=4){
    width = Number(matches[2])
    height = Number(matches[3])
    }
    else return null

    // Tile-size reponse
    var tileWidth:uint = DEFAULT_TILE_WIDTH
    var tileHeight:uint = DEFAULT_TILE_HEIGHT
    matches = metadata.match(/.*(Tile-size:)([0-9\.]+) ([0-9\.]+)/)
    if(matches==null) return null
    if(matches.length>=4){
    tileWidth = Number(matches[2])
    tileHeight = Number(matches[3]);
    }
    else return null

    var source:String = server + "?FIF=" + image

    return new IIPImageDescriptor(source,
    width,
    height,
    tileWidth,
    tileHeight)

    }


    I notice that none of the other descriptor formats make URL connections for XML or otherwise. Only the result of the URL load is passed in, so I've also added a static function to get the appropriate metadata URL for an image given the server location and image name:



    /**
    * Return the IIP URL for making the image metadata request
    */
    public static function getMetaDataURL(image:String, server:String=DEFAULT_SERVER):String
    {
    var url:String = server + "?FIF=" + image + "&obj=IIP,1.0&obj=Max-size&obj=Tile-size&obj=Resolution-number"
    return url
    }



    Then there are some extra defaults to add in the class:


    private static const DEFAULT_TILE_WIDTH:uint = 256
    private static const DEFAULT_TILE_HEIGHT:uint = 256
    private static const DEFAULT_SERVER:String = "/fcgi-bin/iipsrv.fcgi"


    So, to use all this, you just need to load the metadata using a standard urlLoader object, then create the MultiScaleImage and assign the source like this:


    image.source = IIPImageDescriptor.fromBasicInfo( metadataLoader.data, image_path, server )


    I'm not sure this can be easily integrated into your ImagePyramidDescriptorFactory class, however.

    Cheers,
    Ruven
  • question

    Ruven replied on January 18, 2010 23:34 to the question "How Do I Use OpenZoom with djatoka?" in OpenZoom:

    Ruven
    For access to JPEG2000 images without going through java, the IIPImage project (http://iipimage.sf.net) who provide one of the front-ends for djatoka, now also handle JPEG2000 directly in their server http://iipimage.sourceforge.net/2010/...

    Like djatoka, this uses Kakadu, but is entirely written in C++, so no java overhead. As a bonus, the server is compatible with iipmooviewer, deepzoom, zoomify and several other ZUI front-ends, including of course openzoom ;-)