A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Roshit121
Posts: 7 Joined: 2018-03-25T08:01:43+00:00
Authentication code: 1152
Post
by Roshit121 » 2018-03-25T13:29:26+00:00
Hi,
I successfully ran the cylinderize script in Cygwin, but when I tried to run it using php, it did not give the output image.
I tried it using the following code:
Code: Select all
<?php
shell_exec('/cygdrive/c/cygwin64/bin/cylinderize.sh -m vertical -r 370 -l 810 -w 85 -p 5 -e 2 -a -90 -v background -b none -f none -o -100-65 -c multiply image.png mug.png wrap1.png');
?>
Bonzo
Posts: 2971 Joined: 2006-05-20T15:08:19+00:00
Location: Cambridge, England
Post
by Bonzo » 2018-03-25T14:14:25+00:00
Have you changed the permissions for cylinderize.sh?
I used to use 777 but 755 may work.
Also try changing ' ' to " "
fmw42
Posts: 25562 Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2018-03-25T18:41:09+00:00
Try the following and see what error messages you get:
Code: Select all
<?php
exec("bash /cygdrive/c/cygwin64/bin/cylinderize.sh -m vertical -r 370 -l 810 -w 85 -p 5 -e 2 -a -90 -v background -b none -f none -o -100-65 -c multiply image.png mug.png wrap1.png 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
If that works, you can try removing the bash at the beginning.
Roshit121
Posts: 7 Joined: 2018-03-25T08:01:43+00:00
Authentication code: 1152
Post
by Roshit121 » 2018-03-26T05:48:59+00:00
Bonzo wrote: ↑ 2018-03-25T14:14:25+00:00
Have you changed the permissions for cylinderize.sh?
I used to use 777 but 755 may work.
Also try changing ' ' to " "
The permission for cylinderize.sh is 755 and changing ' ' to " " didn't seem to work
Roshit121
Posts: 7 Joined: 2018-03-25T08:01:43+00:00
Authentication code: 1152
Post
by Roshit121 » 2018-03-26T05:51:46+00:00
fmw42 wrote: ↑ 2018-03-25T18:41:09+00:00
Try the following and see what error messages you get:
Code: Select all
<?php
exec("bash /cygdrive/c/cygwin64/bin/cylinderize.sh -m vertical -r 370 -l 810 -w 85 -p 5 -e 2 -a -90 -v background -b none -f none -o -100-65 -c multiply image.png mug.png wrap1.png 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>
If that works, you can try removing the bash at the beginning.
The code gave me the following errors:
Invalid Parameter - configure
Invalid Parameter - image.png
and removing the bash gave me the following error:
The system cannot find the path specified.
snibgo
Posts: 12159 Joined: 2010-01-24T06:01:33+00:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2018-03-26T10:02:05+00:00
"Invalid Parameter" isn't a message that IM produces. It can be produced for the Microsoft Windows program convert.exe, that modifies disk drives.
I suggest you ensure that IM's directory is at the front of PATH, and that PHP sees the same path.
Roshit121
Posts: 7 Joined: 2018-03-25T08:01:43+00:00
Authentication code: 1152
Post
by Roshit121 » 2018-03-26T15:00:26+00:00
snibgo wrote: ↑ 2018-03-26T10:02:05+00:00
"Invalid Parameter" isn't a message that IM produces. It can be produced for the Microsoft Windows program convert.exe, that modifies disk drives.
I suggest you ensure that IM's directory is at the front of PATH, and that PHP sees the same path.
The code seems to run after I added full paths to image and cygwin bash
Code: Select all
<?php
C:\cygwin64\bin\bash.exe --login -c '/cygdrive/c/cygwin64/bin/cylinderize.sh -m vertical -r 370 -l 810 -w 85 -p 5 -e 2 -a -90 -v background -b none -f none -o -100-65 -c multiply C:/xampp/htdocs/test/image.png C:/xampp/htdocs/test/mug.png C:/xampp/htdocs/test/wrap1.png'
?>