google / marzipano

A 360° media viewer for the modern web.
http://www.marzipano.net
Apache License 2.0
2k stars 997 forks source link

Level size is not multiple of tile size: 2288 512 #128

Closed Aykelith closed 6 years ago

Aykelith commented 6 years ago

I'm using this script https://github.com/mpetroff/pannellum/blob/master/utils/multires/generate.py (which uses nona) to generate my multires faces but the script, at the edges, just cut the remaining space so I'm remaining with photos of size like 240x512 and 512x240 and I calculated the size and I'm getting 2288(4*512 + 240) but the library does not accept. How can I resolve the problem? Or if someone can give me a script to generate my images. Thanks

tjgq commented 6 years ago

The level size (i.e. the size of a cube face) must be a multiple of the tile size, and all tiles within a resolution level must be the same size (there can't be a shorter tile at the end). So it looks like you need to pass appropriate --cubesize and --tilesize arguments to the generate.py script.

If your input is an equirectangular image, take the cube size to be something like 1/4 of the equirectangular width (this should approximately preserve the resolution). Then find a submultiple of the cube size close to 512 for the tile size. You might have to adjust the cube size up or down a little to find an appropriate submultiple.

Aykelith commented 6 years ago

Thank you, it's working perfectly. I didn't know why I thought that I can only use power of 2 numbers( maybe older versions of OpenGL rules).

Thank you, again.

TaylorDale commented 5 years ago

This script actually wouldn't work for me until I made the original image a ^2 size. Now it is running well.

The script, in debug mode, reported it was going to generate X size tile images, but actually generated totally different and inconsistently sized ones. Must occur in the 3rd party process it uses.