You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, January 14th 2020, 9:49pm

Tile Filenames Are Suddenly Inconsistent (Zero Padding)?

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.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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


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:

Source code

1
2
3
<image>
    <cube url="tile.php&amp;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

Source code

1
2
3
4
// 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

This post has been edited 7 times, last edit by "martincarlin87" (Jan 14th 2020, 10:18pm)


2

Wednesday, January 15th 2020, 12:11pm

Hi,

thanks for the report!

I can confirm there is a bug there (but an old one, not a new one) - the zero padding depends on the size of the input-image and not on the custom sizes set by the levelsizes settings.

That means when the input-image is smaller than the largest size set in the levelsizes setting, then the padding will be wrong (or better: unexpected, the generated xml itself was matching the output).

This will be corrected soon in the next release (1.20.3).

Best regards,
Klaus

3

Wednesday, January 15th 2020, 12:35pm

Hi again,

btw - I just noticed when using levelsizes setting, the sizes were (wrongly) written in the inverse order in the xml...

Basically this is no problem, the generated xml and tiles are matching, but I'm considering fixing that too for consistency.

That means when fixed you would need to inverse the order of the sizes too - either either in the config file or in your php xml file...

Best regards,
Klaus

4

Wednesday, January 15th 2020, 5:28pm

Hi Klaus,

Thank you very much for taking the time to reply - appreciate it!

No worries, I am just glad to know that there is a reason behind it as I thought I was losing my mind :)

As an aside - would removing %A from the tilepath fix it by preventing the tile filenames from ever being zero padded?

Thanks again,
Martin

5

Wednesday, January 15th 2020, 10:41pm

As an aside - would removing %A from the tilepath fix it by preventing the tile filenames from ever being zero padded?

Yes - the 'A' is for 'automatic' 0 padding. Without the A no zeros will be added - see also here:
https://krpano.com/tools/kmakemultires/config/#tilepath

Posts: 9

Location: Genoa, Italy

Occupation: Photographer, web designer, graphic designer

  • Send private message

6

Tuesday, January 28th 2020, 10:11pm

Hi all,
I'm also having a problem with tile path since 1.20. If levels are 9 or more, folders are named l01, l02, l03... but the xml of path that is generated by the vtour-multires droplet does not contain any zero in the level: panos/pano_6.tiles/%s/l%l/%0v/l%l_%s_%0v_%0h.jpg
So the tiles are not found by the browser.
I'm using the default tilepath template. I need to maintain the zero in level naming, so I can't remove "A" from it. I'd urgently need to find a solution.
When will the new 1.20.3 KRPano release be out?
Best regards and thanks,
Hans