dezoomify icon indicating copy to clipboard operation
dezoomify copied to clipboard

krpano: Uncaught Error: Unable to load tile

Open smxthereisonlyone opened this issue 6 years ago • 13 comments

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

smxthereisonlyone avatar Dec 22 '19 14:12 smxthereisonlyone

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

lovasoa avatar Dec 22 '19 15:12 lovasoa

I just pushed the fix proposed in #136.

lovasoa avatar Dec 22 '19 15:12 lovasoa

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.

lovasoa avatar Dec 22 '19 15:12 lovasoa

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 avatar Dec 23 '19 13:12 smxthereisonlyone

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

smxthereisonlyone avatar Dec 28 '19 12:12 smxthereisonlyone

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

lovasoa avatar Dec 28 '19 13:12 lovasoa

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

smxthereisonlyone avatar Dec 28 '19 14:12 smxthereisonlyone

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

lovasoa avatar Dec 29 '19 10:12 lovasoa

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

smxthereisonlyone avatar Jan 03 '20 13:01 smxthereisonlyone

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 !

lovasoa avatar Jan 03 '20 15:01 lovasoa

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

lovasoa avatar Jan 22 '20 18:01 lovasoa

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

smxthereisonlyone avatar Jan 24 '20 11:01 smxthereisonlyone

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.

lovasoa avatar Jun 07 '20 01:06 lovasoa