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.

    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:

    Code
    <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

    Code
    // 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

  • 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

  • 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

  • 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

  • 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

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!