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, July 31st 2018, 10:57am

How cann i run Krpano bat file from php code on win10

How cann i run Krpano bat file from php code on win10 XAMPP server to make a panorama from web interface

Please help me i am new and i need your support


I tried this code but it failed

Quoted

$path = "C:\xampp\htdocs\krpano\22.jpg";
$preview = str_replace("http://localhost:82/krpano/","C:\xampp\htdocs\krpano\krpano",$path);
$thisfile = str_replace(".jpg","_b.jpg",$preview);

//we check if the cubes are not already created, if not then, call krtransform
if (!file_exists($thisfile)) {
$output = array();
$return_var = 0;
exec("/home1/path/ktransform cube6 $preview $preview -jpegoptimize", $output, $return_var);
}

jordi

Intermediate

Posts: 457

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

2

Wednesday, August 1st 2018, 9:53am

Hi,

I would try something like this

Source code

1
2
3
4
5
6
7
8
9
10
$inputfile = "C:\xampp\htdocs\krpano\22.jpg";
$outputfile = "C:\xampp\htdocs\krpano\22_cube.jpg";

$preview = str_replace("http://localhost:82/krpano/","C:\xampp\htdocs\krpano\krpano",$path);
$thisfile = str_replace(".jpg","_b.jpg",$preview);

//we check if the cubes are not already created, if not then, call krtransform
if (!file_exists($thisfile)) {
      exec("/home1/path/krpanotools sphere2cube cube $inputfile $outputfile", $output);
}


you can check for much options here

PD : the code is untested, and the part of naming you should manage the best way for your needs, I guess that was not the issue.
everpano.com step beyond 360