Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

IIPMOOViewer + DeepZoom

Help
Alvaro
2012-09-24
2012-10-06
  • Alvaro
    Alvaro
    2012-09-24

    Hi there...

    I've seen the DeepZoom support on the latest IIPMOOViewer, so I tried to put
    some DZIs I had working with seadragon, but I couldn't manage to make it work.

    I have the last git version for the beta viewer and basically I did somehing
    like this:

        var iipmooviewer = new IIPMooViewer( "viewer", {
          image: "/path/to/image.dzi",
          credit: "My Title",
          protocol: "deepzoom"
        });
    

    But when I go to the viewer, it just stays blank. I'm I missing something?

    Thx

     
  • Ruven
    Ruven
    2012-09-24

    Well, it should work, but I haven't tested it extensively. Is this on some
    public site somewhere I can take a look at? Otherwise, use Firebug for Firefox
    or the Chrome developer tools to check the console for errors. And don't
    forget that the image path must be the same host as that of the web server
    (Ajax security restrictions).

     
  • Alvaro
    Alvaro
    2012-09-24

    I have two test pages at home, one with an absolute filesystem route:

    188.76.216.89/dz/

    Another with a absolute webserver route:

    188.76.216.89/dz2/

    And another with a relative route:

    188.76.216.89/dz3/

    Do you see something wrong?

    Same deepzoom works fine here:

    188.76.216.89/tmp/seadragonajax/

    I've copied the full dzi and files to each directory.

     
  • Ruven
    Ruven
    2012-09-25

    188.76.216.89 is not up at the moment

     
  • Alvaro
    Alvaro
    2012-09-25

    Ops, maybe it went standby during the night...
    I can access it from outside now...

     
  • Alvaro
    Alvaro
    2012-09-25

    Meanwhile, with firebug, I've found this error:

    [url]http://10.0.50.11/fcgi-bin/iipsrv.fcgi?Deepzoom=/usr/share/nginx/www/dz/adz.dzi.dzi[/url]
    TypeError: /TileSize="(\d+)/.exec(response) is null
    var ts = parseInt( /TileSize="(\d+)/.exec(response)[1] );
    [url]http://10.0.50.11/dz/javascript/protocols.js[/url]
    Line 200
    

    10.0.50.11 is my local IP.

    So seems like:
    It doesn't need the dzi extension declared on 'image'. It adds it anyway.
    It still tries to use the IIPImage server. Theoretically shouldn't be
    necessary with deepzoom images, isn't it?

     
  • Ruven
    Ruven
    2012-09-25

    OK, I see. Set the server parameter for iipmooviewer to / or
    http://10.0.50.11/ then set the image parameter to just
    dz/adz without the dzi suffix. Perhaps indeed the viewer should not be adding
    this suffix ...

     
  • Alvaro
    Alvaro
    2012-09-25

    I had a version some days old, so I 'git cloned' last version, put this
    config:

        new IIPMooViewer( "viewer", {
            image: "/iipmooviewer/adz",
            credit: "Testing",
            protocol: "deepzoom" ,
            server: "/"
        });
    

    And now it's a different error:

    TypeError: Protocols.DeepZoom is not a constructor
    

    That directory looks like this:

    andor@experimental:/usr/share/nginx/www/iipmooviewer$ ls -l
    total 40
    -rw-r--r--  1 www-data www-data   208 Sep 25 12:55 adz.dzi
    drwxr-xr-x 19 www-data www-data  4096 Sep 25 12:55 adz_files
    drwxr-xr-x  2 www-data www-data  4096 Sep 25 12:55 css
    drwxr-xr-x  2 www-data www-data  4096 Sep 25 12:55 images
    -rw-r--r--  1 www-data www-data  2567 Sep 25 13:03 index.html
    drwxr-xr-x  2 www-data www-data  4096 Sep 25 12:55 javascript
    -rw-r--r--  1 www-data www-data 10289 Sep 25 12:55 README.md
    drwxr-xr-x  4 www-data www-data  4096 Sep 25 12:55 src
    

    It's a pity you cannot access, I have some friends testing it, and I even
    tried some external tools, like pingdom, and all can access to:

    http://188.76.216.89/iipmooviewer/

     
  • Alvaro
    Alvaro
    2012-09-25

    I forgot to say the error is on line 4:

    TypeError: Protocols.DeepZoom is not a constructor
    [url]http://10.0.50.11/iipmooviewer/javascript/iipmooviewer-2.0-compressed.js[/url]
    Line 4
    
     
  • Ruven
    Ruven
    2012-09-25

    No, strange, I can't even ping this address from where I am.

    Make sure you include the deepzoom protocol js file. It's not built into the
    "compiled" version by default.
    So, just add this line to your header after the iipmooviewer include:

    <script type="text/javascript" src="src/protocols/deepzoom.js"></script>
    
     
  • Alvaro
    Alvaro
    2012-09-25

    Ok, finally the viewer loads, but the images don't.

    I've spotted the error, it tries to load this urls:
    http://10.0.50.11/iipmooviewer/adz_files/10/1_1.jpg?1348572284392

    When the extension, as declared on the dzi, should be .jpeg instead of .jpg:

    <?xml version="1.0" encoding="UTF-8"?>
    <Image xmlns="[url]http://schemas.microsoft.com/deepzoom/2008[/url]"
      Format="jpeg"
      Overlap="1"
      TileSize="256"
      >
      <Size 
        Height="32914"
        Width="46000"
      />
    </Image>
    

    At least SeaDragon goes directly for the jpeg extension, and when creating
    deepzoom images on VIPS, it will use that extension.

    I change lines 15 and 43 of src/protocols/deepzoom.js, converting 'jpg' in
    'jpeg' and starts working.

    My thumbnail isn't working, but it's my fault on converting the first layer.

    So, I would change some things:

    Not adding the dzi extension automagically, to avoid confusion. Also, I think
    that the deepzoom protocol says it also can be .xml files.

    Also, I think it would be nice to update the README or docs for the correct
    sintax for configuring deepzoom images:

        new IIPMooViewer( "viewer", {
        image: "route/to/file.dzi",
        credit: "Whatever",
        protocol: "deepzoom" ,
        server: "/"
        });
    

    And maybe changing that .jpg extension to .jpeg

    Should I make a commit or it's not necessary for such a small change?

     
  • Ruven
    Ruven
    2012-09-25

    OK, I just did an update to the code on git - I removed the .dzi and it now
    uses the suffix given in the xml. I haven't tested it, but please try it out!

     
  • Alvaro
    Alvaro
    2012-09-25

    That sounds perfect...
    I'll update tomorrow and see how it's working.

    Also, I'll try to find a problem with VIPS. When I generate a deepzoom with
    VIPS it creates the first zoom levels in blank. Like from 1 to 6 or so.

    I'll try some different images and let you know this week how it's working :D

    Thanks!

     
  • Alvaro
    Alvaro
    2012-09-26

    I cloned the last version and got this problem, I think when it tries to parse
    the extension:

    TypeError: /Format="(\s+)/.exec(response) is null
    [url]http://188.76.216.89/visor2/src/protocols/deepzoom.js[/url]
    Line 21
    
     
  • Ruven
    Ruven
    2012-09-26

    OK, that should, of course, have been \w+ and not \s+ for the format string
    ;-)
    Fix uploaded to github just now.

     
  • Alvaro
    Alvaro
    2012-09-26

    Good :D

    I cought another bug on the flight, related to the dzi extension ;)

    Now it tries to get this jpeg images:

    http://188.76.216.89/visor2/CMU-2.dzi_files/0/0_0.jpeg

    You see it keeps the full name of the file, with the '.dzi' part that
    shouldn't be used here.
    That may be why, on the beginning, the config was using the name without the
    file extension, to avoid this headaches...

    So we can keep the extension out again, or maybe parse it out, as, and I'm not
    really sure, it can be different from .dzi, maybe .xml.

    Maybe just go back to "no extension" and say in docs it must be always ".dzi".

     
  • Ruven
    Ruven
    2012-09-26

    OK, I think it's best if the name you give is the name of this .dzi or .xml
    file, so I've changed it to now strip these off when making tile requests.
    Hopefully this will now work properly! Please try now!

     
  • Alvaro
    Alvaro
    2012-09-26

    git clone

    • <script type="text/javascript" src="src/protocols/deepzoom.js"></script>

    •     new IIPMooViewer( "viewer", {
              image: "visor2/CMU-2.dzi",
              credit: "Testing",
              protocol: "deepzoom" ,
              server: "/"
              });
      

    =
    Up and running with no problem!

    Now, I'll see how to sort out that VIPS generates the first 8 levels (0 to 7)
    too small to be used as a thumbnail. IIPMOOViewer always takes the number 0 as
    a thumbnail, and the 0 is 1x1pixels big, so it's no use for it. As I can see,
    the level 8 usually is the first useful for thumbnailing.

    I can invistigate a bit and open a new thread later, and, if you are
    interested, give you some demo images.

    Thanks!

     
  • Ruven
    Ruven
    2012-09-26

    Up and running with no problem!

    Good! :-)

    I can invistigate a bit and open a new thread later, and, if you are
    interested, give you some demo images.

    Yes, definitely.

     


Anonymous


Cancel   Add attachments