function processDzi(options) {
        var imageNode = $(options.data.documentElement);
        if (!imageNode || imageNode.prop('tagName') !== 'Image') {
            that.fail('Sorry, we only support Deep Zoom Image!');
        }

        var fileFormat = imageNode.attr('Format');

        var sizeNode = imageNode.children('size');

        var invalidFormatMessage = 'This doesn\'t appear to be a valid Deep Zoom Image.';
        if (!sizeNode) {
            that.fail(invalidFormatMessage);
        }

        var width = parseInt(sizeNode.attr('Width'), 10);
        var height = parseInt(sizeNode.attr('Height'), 10);
        var tileSize = parseInt(imageNode.attr('TileSize'), 10);
        var tileOverlap = parseInt(imageNode.attr('Overlap'), 10);

        if (!width || !height || !tileSize) {
            that.fail(invalidFormatMessage);
        }

        // If tilesUrl were not provided, the default path is the same as imageDataUrl with ".dzi"
        // changed into "_files".
        var tilesUrl = options.tilesUrl || options.imageDataUrl.replace(/\.dzi$/, '_files/');

        if (!options.bounds) {
            options.bounds = new Malakh.Rectangle(0, 0, width, height); // default bounds copied from DZI
        }

        return that.DziImage({
            width: width,
            height: height,
            tileSize: tileSize,
            tileOverlap: tileOverlap,
            tilesUrl: tilesUrl,
            fileFormat: fileFormat,
            bounds: options.bounds,
        });
    }
/**
     * Processes a DZI file, creating a <code>DziImage</code> instance.
     *
     * @param {Object} options An object containing all given options.
     * @param {Document} options.data An object representing a DZI file.
     * @param {string} options.imageDataUrl See <a href="#createFromDzi">
     *                                      <code>Malakh.DziImage.createFromDzi</code></a>.
     * @param {string} [options.tilesUrl] See <a href="#createFromDzi"><code>Malakh.DziImage.createFromDzi</code></a>
     * @param {Document} [options.bounds] Bounds in which an image must fit. If not given, we assume the rectangle
     *                                    <code>[0, 0, width x height]</code> where <code>width</code> and
     *                                    <code>height</code> are taken from DZI.
     * @return {Malakh.DziImage}
     *
     * @memberof Malakh.Controller~
     * @private
     */
Processes a DZI file, creating a DziImage instance.
@param {Object} options An object containing all given options.
@param {Document} options.data An object representing a DZI file.


Processes a DZI file creating a DziImage instance . @param { Object } options An object containing all given options . @param { Document } options . data An object representing a DZI file .
function processDzi(options) {
        var imageNode = $(options.data.documentElement);
        if (!imageNode || imageNode.prop('tagName') !== 'Image') {
            that.fail('Sorry, we only support Deep Zoom Image!');
        }
        var fileFormat = imageNode.attr('Format');
        var sizeNode = imageNode.children('size');
        var invalidFormatMessage = 'This doesn\'t appear to be a valid Deep Zoom Image.';
        if (!sizeNode) {
            that.fail(invalidFormatMessage);
        }
        var width = parseInt(sizeNode.attr('Width'), 10);
        var height = parseInt(sizeNode.attr('Height'), 10);
        var tileSize = parseInt(imageNode.attr('TileSize'), 10);
        var tileOverlap = parseInt(imageNode.attr('Overlap'), 10);
        if (!width || !height || !tileSize) {
            that.fail(invalidFormatMessage);
        }
        var tilesUrl = options.tilesUrl || options.imageDataUrl.replace(/\.dzi$/, '_files/');
        if (!options.bounds) {
            options.bounds = new Malakh.Rectangle(0, 0, width, height); 
        }
        return that.DziImage({
            width: width,
            height: height,
            tileSize: tileSize,
            tileOverlap: tileOverlap,
            tilesUrl: tilesUrl,
            fileFormat: fileFormat,
            bounds: options.bounds,
        });
    }
function processDzi ( options ) { var imageNode = $ ( options . data . documentElement ) ; if ( ! imageNode || imageNode . prop ( 'tagName' ) !== 'Image' ) { that . fail ( 'Sorry, we only support Deep Zoom Image!' ) ; } var fileFormat = imageNode . attr ( 'Format' ) ; var sizeNode = imageNode . children ( 'size' ) ; var invalidFormatMessage = 'This doesn\'t appear to be a valid Deep Zoom Image.' ; if ( ! sizeNode ) { that . fail ( invalidFormatMessage ) ; } var width = parseInt ( sizeNode . attr ( 'Width' ) , 10 ) ; var height = parseInt ( sizeNode . attr ( 'Height' ) , 10 ) ; var tileSize = parseInt ( imageNode . attr ( 'TileSize' ) , 10 ) ; var tileOverlap = parseInt ( imageNode . attr ( 'Overlap' ) , 10 ) ; if ( ! width || ! height || ! tileSize ) { that . fail ( invalidFormatMessage ) ; } var tilesUrl = options . tilesUrl || options . imageDataUrl . replace ( / \.dzi$ / , '_files/' ) ; if ( ! options . bounds ) { options . bounds = new Malakh . Rectangle ( 0 , 0 , width , height ) ; } return that . DziImage ( { width : width , height : height , tileSize : tileSize , tileOverlap : tileOverlap , tilesUrl : tilesUrl , fileFormat : fileFormat , bounds : options . bounds , } ) ; }
Processes a DZI file, creating a <code>DziImage</code> instance.
Processes a DZI file creating a <code > DziImage< / code > instance .
// If tilesUrl were not provided, the default path is the same as imageDataUrl with ".dzi" // changed into "_files". // default bounds copied from DZI