Loading ...
Sorry, an error occurred while loading the content.
 

KRPano and PHP

Expand Messages
  • Keith Martin
    Here s an interesting thing. Okay, interesting to some of us anyway... :-) I ve been putting together a tour using KRPano. It is a good tool for this sort of
    Message 1 of 10 , May 28, 2009
      Here's an interesting thing. Okay, interesting to some of us anyway... :-)

      I've been putting together a tour using KRPano. It is a good tool for
      this sort of thing, but it can be a bit tedious using the same code
      in the XML file over and over again.

      Now, there may be a ready-made way of dealing with this, but I
      wondered whether I could use basic PHP. So...

      1) In the HTML file I changed the reference from pano.xml to pano.php instead.
      2) I renamed the XML file so it ended with .php instead of .xml.
      3) In the XML file contents I used a snippet of PHP to write some of
      the code I needed.

      The idea being that the web page would call the PHP file, the server
      would parse it (because the file name ends in .php) and process any
      PHP instructions, which in this test case involved writing out a
      necessary bit of the XML code. Then the server would pass the
      (processed) data back, and KRPano would carry on as normal.

      I was worried that KRPano wmight not like being asked to use a file
      ending with .php rather than .xml for its instructions - but it works
      perfectly, at least for this test.

      Why is this interesting? Well, it means I can use PHP to 'include'
      external code elements stored in separate files, so I can write them
      once and reuse them in many different panos by simply including them
      into the XML on the fly. Major tedium eliminator.

      I can also use PHP variables to use non-hard-wired data - although
      KRPano supports variables (and math operators and if/then structures)
      within the XML, so that's actually not so critical.

      k
    • aiwetir
      Keith, if you haven t already, you may want to add some header info to the file so it sends the proper headers header( Content-type: text/xml ); at a minimum.
      Message 2 of 10 , May 28, 2009
        Keith,

        if you haven't already, you may want to add some header info to the
        file so it sends the proper headers

        header("Content-type: text/xml");
        at a minimum.


        mmm
        http://pdxvr.com
        http://medina-photo.com


        On 28 May 2009, at 12:47, Keith Martin wrote:

        >
        >
        > Here's an interesting thing. Okay, interesting to some of us
        > anyway... :-)
        >
        > I've been putting together a tour using KRPano. It is a good tool for
        > this sort of thing, but it can be a bit tedious using the same code
        > in the XML file over and over again.
        >
        > Now, there may be a ready-made way of dealing with this, but I
        > wondered whether I could use basic PHP. So...
        >
        > 1) In the HTML file I changed the reference from pano.xml to
        > pano.php instead.
        > 2) I renamed the XML file so it ended with .php instead of .xml.
        > 3) In the XML file contents I used a snippet of PHP to write some of
        > the code I needed.
        >
        > The idea being that the web page would call the PHP file, the server
        > would parse it (because the file name ends in .php) and process any
        > PHP instructions, which in this test case involved writing out a
        > necessary bit of the XML code. Then the server would pass the
        > (processed) data back, and KRPano would carry on as normal.
        >
        > I was worried that KRPano wmight not like being asked to use a file
        > ending with .php rather than .xml for its instructions - but it works
        > perfectly, at least for this test.
        >
        > Why is this interesting? Well, it means I can use PHP to 'include'
        > external code elements stored in separate files, so I can write them
        > once and reuse them in many different panos by simply including them
        > into the XML on the fly. Major tedium eliminator.
        >
        > I can also use PHP variables to use non-hard-wired data - although
        > KRPano supports variables (and math operators and if/then structures)
        > within the XML, so that's actually not so critical.
        >
        > k
        >



        [Non-text portions of this message have been removed]
      • Keith Martin
        ... Good point. I only just thought of trying this so I ve not really sorted things out properly yet. k
        Message 3 of 10 , May 28, 2009
          Sometime around 28/5/09 (at 13:38 -0700) aiwetir said:

          >if you haven't already, you may want to add some header info

          Good point. I only just thought of trying this so I've not really
          sorted things out properly yet.

          k
        • Roger Howard
          ... Since it worked, this is less useful - but had it been hardwired, for some strange reason, to only deal with uri s ending with .xml then you could always
          Message 4 of 10 , May 28, 2009
            On May 28, 2009, at 12:47 PM, Keith Martin wrote:
            > I was worried that KRPano wmight not like being asked to use a file
            > ending with .php rather than .xml for its instructions - but it works
            > perfectly, at least for this test.
            >

            Since it worked, this is less useful - but had it been hardwired, for
            some strange reason, to only deal with uri's ending with ".xml" then
            you could always have setup your Apache to pass xml files off to PHP
            for preprocessing (and then just name a PHP file *.xml, and write it
            as normal), or alternately (and maybe easier, depending on how much
            control you have over your Apache config) use mod_rewrite to simply
            pretend your .php files are in fact .xml

            Sounds like that trickery isn't necessary, but I've had similar
            instances where an app was hardcoded to a static extension and, thanks
            to the flexibility of modern web servers there's never something you
            can't do to trick a client-side application.

            -R
          • Erik Krause
            ... It works perfectly. My krpano QTVR parser (derived from Spi-V QTVR parser) for versions prior to 1.0.8 works this way. It reads the QTVR by PHP and outputs
            Message 5 of 10 , Jun 7, 2009
              Keith Martin wrote:

              > I was worried that KRPano wmight not like being asked to use a file
              > ending with .php rather than .xml for its instructions - but it works
              > perfectly, at least for this test.

              It works perfectly. My krpano QTVR parser (derived from Spi-V QTVR
              parser) for versions prior to 1.0.8 works this way. It reads the QTVR by
              PHP and outputs a XML on the fly, which contains the URLs of a PHP image
              handler which in turn reads the QTVR and outputs JPEGs.

              best regards
              --
              Erik Krause
              http://www.erik-krause.de
            • Rick Drew
              Just curious - can it read any external file? If I write a CF script that returns the correctly formatted data, will that work? I d live to make my site
              Message 6 of 10 , Jun 7, 2009
                Just curious - can it read any external file? If I write a CF script that
                returns the correctly formatted data, will that work? I'd live to make my
                site database driven.



                Rick Drew



                [Non-text portions of this message have been removed]
              • Uri Cogan
                Can anyone comment on the suitability of the Canon Rebel XT with a Tokina 10-17mm lens for panorama creation? I heard good things about the Tokina lens, but I
                Message 7 of 10 , Jun 7, 2009
                  Can anyone comment on the suitability of the Canon Rebel XT with a
                  Tokina 10-17mm lens for panorama creation?

                  I heard good things about the Tokina lens, but I know nothing about that
                  Canon Rebel XT.

                  TIA, Uri.
                • yuval_levy
                  Hi Uri, ... the Canon Rebel XT is great for panoramas. I know you re a Nikon user. The difference between this Canon and the comparable Nikon is the sensor
                  Message 8 of 10 , Jun 8, 2009
                    Hi Uri,

                    --- In PanoToolsNG@yahoogroups.com, Uri Cogan <uri@...> wrote:
                    > I know nothing about that Canon Rebel XT.

                    the Canon Rebel XT is great for panoramas.

                    I know you're a Nikon user. The difference between this Canon and the comparable Nikon is the sensor size. Canon's is slightly smaller (crop factor 1.6 as opposed to 1.5 for the Nikon). The result is higher panorama resolution at comparable megapixel count. The trade off is that you have less overlap, which is somewhat critical if you want to shoot three around on an 8mm lens, but for the Tokina 10-17mm the number of shoots around for a full spherical is the same whether the sensor has crop 1.5 or 1.6.

                    Yuv
                  • Uri Cogan
                    ... Toda raba, yuv! [Non-text portions of this message have been removed]
                    Message 9 of 10 , Jun 8, 2009
                      yuval_levy wrote:


                      > --- In PanoToolsNG@yahoogroups.com, Uri Cogan <uri@...> wrote:
                      >
                      >> I know nothing about that Canon Rebel XT.
                      >>
                      >
                      > the Canon Rebel XT is great for panoramas.


                      Toda raba, yuv!


                      [Non-text portions of this message have been removed]
                    • dan.moylan
                      Uri, i use a canon 400d, which i believe is the same as the xti model, with the tokina 10-17mm.very happy with the combination and resulting tours.
                      Message 10 of 10 , Jun 8, 2009
                        Uri, i use a canon 400d, which i believe is the same as the xti model, with the tokina 10-17mm.very happy with the combination and resulting tours.
                      Your message has been successfully submitted and would be delivered to recipients shortly.