using iipmooviewer without a web server (from local disk)

Help
DGSL
2014-03-30
2014-04-03
  • DGSL
    DGSL
    2014-03-30

    Hello

    I tried to run iipmooviewer zoom into tiles created with Zoomify, for a project which must be running from a CD or a local disk (so running iipserver is not possible in this case; but I want to use iipmooviewer rather than zoomify client).

    My zoomify example page runs without problems. Extract code of the relevant part:

    C:\mypath\ZoomifyExpress4-Win\zoomifytest.html
    
    <TD><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="750" HEIGHT="450" ID="theMovie">
    <PARAM NAME="FlashVars" VALUE="zoomifyImagePath=../exampleimage1">
    <PARAM NAME="MENU" VALUE="FALSE">
    <PARAM NAME="SRC" VALUE="ZoomifyViewer.swf">
    <EMBED FlashVars="zoomifyImagePath=../exampleimage1" SRC="ZoomifyViewer.swf" MENU="false" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"  WIDTH="750" HEIGHT="450" NAME="theMovie"></EMBED>
    </OBJECT></TD>
    

    exampleimage1 is the folder containing the zoomify ImageProperties.xml file, and the folders containing the tiles:

    C:\mypath\exampleimage1\ImageProperties.xml
    C:\mypath\exampleimage1\TileGroup0\0-0-0.jpg
    (...)
    C:\mypath\exampleimage1\TileGroup0\2-2-3.jpg
    

    But I am not being able to configure iipmooviewer to visualize the same image tiles.
    This is what I tried so far (show only the end of my code which I think is the relevant stuff):

    C:\mypath\iipmooviewer-master\zoomifyiipimagetest.html
    
    <script src="http://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
    <script type="text/javascript" src="js/iipmooviewer-2.0-min.js"></script>
    <script type="text/javascript" src="src/protocols/zoomify.js"></script>
    <script type="text/javascript">
     // Create our iipmooviewer object
     new IIPMooViewer( "viewer", {
       server: "../",
       image: "exampleimage1",
       protocol: "zoomify"
     });
    </script>
    
    </head>
    
    <body>
        <div id="viewer"></div>
    </body>
    

    Doesn't work.
    I just got this Javascript alert:

    Error: no response from server "../"
    

    And from Chrome Javascript console I got these messages, which I do not understand at all:

    OPTIONS file:///C:/mypath/exampleimage1/ImageProperties.xml No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. mootools-yui-compressed.js:485
    
    XMLHttpRequest cannot load file:///C:/mypath/exampleimage1/ImageProperties.xml. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. zfiipimage2.html:1
    
    Uncaught TypeError: Cannot call method 'split' of undefined zoomify.js:22
    

    How can I solve this?
    Remember I need it to run from a CD or from the hard disk path were my client decides to copy all the files (so I need to use relative paths from the script, since I cannot know in advance the absolute paths).

    Many thanks in advance

    David

     
  • Ruven
    Ruven
    2014-03-31

    The error is because your browser does not allow Ajax requests to a different domain from the one the page is hosted on. What URL are you using to access your page? Are you using "C:\mypath\iipmooviewer-master\zoomifyiipimagetest.html" directly?

     
    • DGSL
      DGSL
      2014-03-31

       
      Last edit: DGSL 2014-03-31
  • DGSL
    DGSL
    2014-03-31

    Yes. I do the same for zoomify client test page and it works. These are the urls copied-pasted from Chrome address bar:

    file:///C:/mypath/ZoomifyExpress4-Win/zoomifytest.html
    (it works)

    file:///C:/mypath/iipmooviewer-master/zoomifyiipimagetest.html
    (doesn't work)

    What urls should I use to make it work?
    (actually, everything is within C:/mypath, so there is not a different domain ... well, there is no domain, I think)

     
    Last edit: DGSL 2014-03-31
  • Ruven
    Ruven
    2014-04-01

    I presume you're using the zoomify flash client? If so, then it works because flash does not have the same same origin security as javascript.

    Try first setting the server parameter in your html to something like file:\\ plus the full path. Get that working first, then start trying with relative paths.

     
  • DGSL
    DGSL
    2014-04-01

    Thanks Ruven. I tried that but couldn't get it working.

    I used forward slashes (like the url from the address bar) ... not sure if that is the correct way, but now I tried backslashes and the problem persists.
    Have you tried that before and worked?? Please share your example

    Maybe I misunderstood the scenario you refer to in this sentence:
    "IIPMooViewer, however, also supports the Zoomify and Deepzoom protocols if you are unable to install the server or are working in a legacy environment."
    https://github.com/ruven/iipmooviewer

    Which kind of environment would that be? Did you not mean something like what I am trying?

    Thanks

    BTW - Yes, zoomify flash client in the other working scenario

     
    Last edit: DGSL 2014-04-01
  • Ruven
    Ruven
    2014-04-01

    No, I've never tried to load local files. IIPMooViewer supports zoomify and deepzoom tiles when hosted through a web server.

    So, I've done some investigating and it looks like you cannot run AJAX requests at all on a local file. So, you can either

    1) Setup a simple web server on your local machine and run everything through that.
    2) Or you can try modifying your browser as described here: https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally
    3) Or use flash and IIPZoom instead of IIPMooViewer

     
  • DGSL
    DGSL
    2014-04-03

    OK thanks a lot for the advices!

     


Anonymous


Cancel   Add attachments