These are chat archives for openseadragon/openseadragon

5th
Aug 2018
Ian Gilman
@iangilman
Aug 05 2018 00:26
@bpirih_gitlab well, homeFillsViewer means that it will crop the image rather than letterboxing, but yes, it should be larger in the viewer regardless. The fact that you're getting those 403s is definitely a sign the numbers are off.
So, what if you try 8192 divided by 2? Or multiplied by 2?
(It's one quarter of the area, but that's half width/height)
Benjamin Pirih
@bpirih_gitlab
Aug 05 2018 01:20
Thank Ian.. i tried both of those things.. no luck..
we use this same data for google maps and it renders correctly.. I do agree with your statement that those numbers are off but just not sure how to fix it.. Again thanks for all your help!
Ian Gilman
@iangilman
Aug 05 2018 01:22
So the results are the same regardless of what number you put in?
By the way, do you know what the image is supposed to look like? In the screenshot above, is that the entire image (just too small), or is there supposed to be additional stuff in it?
Benjamin Pirih
@bpirih_gitlab
Aug 05 2018 02:24
So i'm seeing the entire image but it is too small.. only a 1/4.. if I only multiple the height by * 2 then I see the correct height but the image is not aligned correctly..
image.png
which is closer but still off..
here is what I'm trying to get but I had to manipulate the placement with the mouse..
image.png
Ian Gilman
@iangilman
Aug 05 2018 02:27
Cool. I assume you're still getting errors in the console?
My guess is that the tiles are somehow generated one level off from what the tile source code is expecting.
Let's try hacking the tile source codeā€¦ Here's what it is currently:
    getTileUrl: function( level, x, y ) {
        // Convert from Deep Zoom definition to TMS zoom definition
        var yTiles = this.getNumTiles( level ).y - 1;

        return this.tilesUrl + level + "/" + x + "/" + (yTiles - y) + ".png";
    }
try adding level++ or level-- above the return
Ian Gilman
@iangilman
Aug 05 2018 02:33
You can literally drop that into the tile source, like so:
tileSources:   [{
    type:       'tiledmapservice',
    tilesUrl:   'http://tilecache.osgeo.org/wms-c/tilecache.py/1.0.0/basic/',
    width: 8192,
    height: 8192,
    getTileUrl: function( level, x, y ) {
        // Convert from Deep Zoom definition to TMS zoom definition
        var yTiles = this.getNumTiles( level ).y - 1;

        level++;
        return this.tilesUrl + level + "/" + x + "/" + (yTiles - y) + ".png";
    }
}]
Benjamin Pirih
@bpirih_gitlab
Aug 05 2018 03:43
let me try.. thanks Ian!!
Benjamin Pirih
@bpirih_gitlab
Aug 05 2018 03:56
awesome! that seemed to fix it..
I had to specify this..
minLevel: 0,
maxLevel: 4,
What is strange though now it is doesn't appear I can zoom all the way out to level 0.. where you would just show 1 256 image...
but much closer!! thank you!!
image.png
here is my current code:
            var viewer = OpenSeadragon({
                id:                 "contentDiv",
                prefixUrl:          "{!URLFOR($Resource.OpenSeaDragon, '/images/')}",
                showNavigator:      false,
                wrapHorizontal:     false,
                zoomPerScroll:      1.2,
                minZoomLevel:         0.1,
                maxZoomLevel:        12,
                homeFillsViewer:    true,
                navigationControlAnchor:     OpenSeadragon.ControlAnchor.BOTTOM_RIGHT,
                //minZoomImageRatio:  0,
                //defaultZoomLevel:   ,
                //panHorizontal:         true,
                //panVertical:         true,
                //visibilityRatio:    1,
                //constrainDuringPan: true,
                debugMode:            true,
                tileSources:   [{
                    type:       'tiledmapservice',
                    tilesUrl:   imageServerPath,
                    tileSize: 256,
                    width: 8192, 
                    height: 8192,
                    minLevel: 0,
                    maxLevel: 4,
                    getTileUrl: function( level, x, y ) {
                         // Convert from Deep Zoom definition to TMS zoom definition
                         var yTiles = this.getNumTiles( level ).y - 1;

                         level++;

                         return this.tilesUrl + level + "/" + x + "/" + (yTiles - y) + ".png";
                     }

                }]
            });