krpano: Uncaught Error: Unable to load tile
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
Hello, Can you please provide more information ?
- What is thee URL you are giving to dezoomify ?
- What is the complete error message you receive (including the URL it says it cannot access).
Without these information, this bug report is not actionable.
Cheers
I just pushed the fix proposed in #136.
Concerning using dezoomify locally: the easiest I think is the following:
git clone [email protected]:lovasoa/dezoomify.git
cd dezoomify
php -S localhost:5000
then open http://localhost:5000 in your browser.
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
@lovasoa Would it be possible to add the functionality to download all perspectives of the 360° image and not only one?
Yes, I think it is indeed possible. Pull requests are welcome!
@lovasoa Sorry no idea how to start about doing that - do you have an idea?
You should start by reading the code of the existing krpano dezoomer and trying to understand the krpano format
@lovasoa Hm, I have a hard time understanding - can you lend a hand?
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:
- forward
- back
- left
- right
- up
- down
Good luck, and do not hesitate to ask more questions here !
@smxthereisonlyone : any progress ? Do you need more help ?
@lovasoa Hey, sorry tried and failed when trying for a short time. Would you have time to try?
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.