Hi there,
I have been using krpano for a couple of weeks now and enjoying learning more about it each day.
When I first started, I was generating html, js and xml in a standalone directory for every image, but now we have figured out a way to make it generic on our web app and so only need to generate the tiles and preview images.
The problem I am suddenly having after making this change, the tile file names are no longer being zero padded. The only change to the config file was commenting out some lines so that only the images were generated and no templates.
# basic settings
panotype=autodetect
hfov=360
vfov=180
voffset=0
stereosupport=true
# convert spherical/cylindrical to cubical
converttocube=true
converttocubelimit=360x120
# multiresolution settings
multires=true
tilesize=512
levels=auto
levelstep=1.5
levelsizes=512,1024,2048,4096,8192
maxsize=auto
maxcubesize=auto
leveldownload=auto
adjustlevelsizes=true
# output images path
tilepath=%INPUTPATH%/tiles/l%Al[_c]_%Av_%Ah.jpg
tilepathxml=[PATH]
indexbase=1
# preview pano settings
preview=true
cspreview=true
graypreview=false
previewsmooth=25
previewpath=%INPUTPATH%/tiles/preview.jpg
previewpathxml=[PATH]
# xml output
# xml=true
# xml is built dynamically using spherical-xml.php and not once per execution
xml=false
# xmlpath=%INPUTPATH%/index.xml
# xmltemplate=/usr/local/bin/krpano/templates/xml/default.xml
# askforxmloverwrite=false
# makescenes=false
# html output/template
# html=true
html=false
# htmlpath=%INPUTPATH%/index.html
# htmltemplate=/usr/local/bin/krpano/templates/html/embedpano.html
# html5=true
autolevel=remap
# compression settings
jpegquality=90
jpegoptimize=true
Alles anzeigen
For example, previously tile file names were l1_b_01_01.jpg but now they are l1_b_1_1.jpg.
I thought that maybe they were zero padded when generating templates, for some reason.
Our xml is being served by php:
<image>
<cube url="tile.php&tile=l%l_%s_%0v_%0h.jpg" multires="512,8192,4096,2048,1024,512" />
</image>
but it's obviously not finding the tiles because they no longer have the zero padding. From reading the docs, %A in the tilepath should do this, but is there another approach I can use? I don't mind which format I get, so long as it is always consistent.
I can maybe do something in the tile.php file like
// tile name format could be l%l_%s_%v_%h.jpg OR l%l_%s_%0v_%0h.jpg so try and account for both
if (!file_exists($filePath)) {
$filePath = str_replace('0', '', $filePath);
}
but it's not ideal.
Thanks,
Martin