lovasoa / dezoomify

Dezoomify is a web application to download zoomable images from museum websites, image galleries, and map viewers. Many different zoomable image technologies are supported.
https://dezoomify.ophir.dev
GNU General Public License v2.0
657 stars 71 forks source link

krpano: Uncaught Error: Unable to load tile #347

Open smxthereisonlyone opened 4 years ago

smxthereisonlyone commented 4 years ago

Trying to download a krpano image - I always get the error:

"Uncaught Error: Unable to load tile. Check that your internet connection is working and that you can access this url:"

When I try to load the URL - it's not available.

Issue #136 mentioned a solution but it's not live in master?

When I try to do live-server locally it doesn't work at all.

Cheers @lovasoa

lovasoa commented 4 years ago

Hello, Can you please provide more information ?

Without these information, this bug report is not actionable.

Cheers

lovasoa commented 4 years ago

I just pushed the fix proposed in #136.

lovasoa commented 4 years ago

Concerning using dezoomify locally: the easiest I think is the following:

git clone git@github.com:lovasoa/dezoomify.git
cd dezoomify
php -S localhost:5000

then open http://localhost:5000 in your browser.

smxthereisonlyone commented 4 years ago

Thanks @lovasoa! Trying it out now!

Please take a look at this example from krpano themselves: https://krpano.com/plugins/threejs/opensource/

When trying it on that image - it only shows one direction for download?

It seems like it's not trying to download the full sphere but only parts of it - specifically the start direction when reloading the panorama.

Cheers

smxthereisonlyone commented 4 years ago

@lovasoa Would it be possible to add the functionality to download all perspectives of the 360° image and not only one?

lovasoa commented 4 years ago

Yes, I think it is indeed possible. Pull requests are welcome!

smxthereisonlyone commented 4 years ago

@lovasoa Sorry no idea how to start about doing that - do you have an idea?

lovasoa commented 4 years ago

You should start by reading the code of the existing krpano dezoomer and trying to understand the krpano format

smxthereisonlyone commented 4 years ago

@lovasoa Hm, I have a hard time understanding - can you lend a hand?

lovasoa commented 4 years ago

I think a good place to start is this line: https://github.com/lovasoa/dezoomify/blob/master/dezoomers/krpano.js#L79

            function replacer(match, zeroes, letter) {
                    var val = ({
                        h:col, x:col, u:col, c:col,
                        v:row, y:row, r:row,
                        s:"f"
                    }[letter]).toString();
                    while(val.length < zeroes.length) val = "0" + val;
                    return val;
            }
            return data.url.replace(/%(0*([a-z]))/g, replacer);

It replaces %s by f in the tile URL template. The template itself is extracted from an xml file and contains something like:

    <image type="CUBE" multires="true" tilesize="512">
        <level tiledimagewidth="1536" tiledimageheight="1536">
            <cube url="pano.tiles/%s_%v_%h.jpg" />
        </level>
    </image>

It looks like there can be several image types. In your example, the panorama seems to be composed of images placed on a cube. I think %s represents a side of the cube (a direction). f is the designation of one of the directions, and dezoomify downloads only this one. However, there seem to be other as well, such as b, u, d, l, r. I'd say these are the first letters of the names they gave to the faces of the cube:

Good luck, and do not hesitate to ask more questions here !

lovasoa commented 4 years ago

@smxthereisonlyone : any progress ? Do you need more help ?

smxthereisonlyone commented 4 years ago

@lovasoa Hey, sorry tried and failed when trying for a short time. Would you have time to try?

lovasoa commented 4 years ago

For those interested: I've added support for krpano in dezoomify-rs. The version in dezoomify-rs lets you choose which pane of the image you want to download, so you can download all of them.