How to convert an image into cylinderical image usng imagemagic?
-
- Posts: 11
- Joined: 2016-09-12T07:43:22-07:00
- Authentication code: 1151
How to convert an image into cylinderical image usng imagemagic?
HEllo guys,
I want to convert an image into cylindrical image. I tried the script from http://www.fmwconcepts.com/imagemagick/cylinderize/ and tried this command >> 'pyhysical_path_of_mydomain/cylinderize.sh' -m vertical -v background -b none -p 20 -t physical_path_of_mydomain/f4.jpg physical_path_of_mydomain/lamp_view/uploads/cyl_f2.jpg from server shell command it works for me, but not getting result when execute in php script. please help me and provide an example of command that you get cylindrical image from plain image.
I want to convert an image into cylindrical image. I tried the script from http://www.fmwconcepts.com/imagemagick/cylinderize/ and tried this command >> 'pyhysical_path_of_mydomain/cylinderize.sh' -m vertical -v background -b none -p 20 -t physical_path_of_mydomain/f4.jpg physical_path_of_mydomain/lamp_view/uploads/cyl_f2.jpg from server shell command it works for me, but not getting result when execute in php script. please help me and provide an example of command that you get cylindrical image from plain image.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to convert an image into cylinderical image usng imagemagic?
Code: Select all
exec("-m vertical -v background -b none -p 20 -t mydomainame/f4.jpg mydomainame/cylindrical_image.jpg 2>&1", $array)
If that wasn't your code, tell us what you really used.
What version of IM? On what platform? What error messages did you get?
snibgo's IM pages: im.snibgo.com
-
- Posts: 11
- Joined: 2016-09-12T07:43:22-07:00
- Authentication code: 1151
Re: How to convert an image into cylinderical image usng imagemagic?
Thank you for your reply and we are appreciate your reply.
I had used your mention command exec("-m vertical -v background -b none -p 20 -t mydomainame/f4.jpg mydomainame/cylindrical_image.jpg 2>&1", $array) and print the array. the array show empty and version of image magic is show in the bellow screenshot link >> http://prntscr.com/dc0hgy and When including script gives this error >>http://prntscr.com/dc0kwg
I had used your mention command exec("-m vertical -v background -b none -p 20 -t mydomainame/f4.jpg mydomainame/cylindrical_image.jpg 2>&1", $array) and print the array. the array show empty and version of image magic is show in the bellow screenshot link >> http://prntscr.com/dc0hgy and When including script gives this error >>http://prntscr.com/dc0kwg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to convert an image into cylinderical image usng imagemagic?
If you are using my script, cylinderize, then you must include the script name in your exec command
exec("cylinderize -m vertical -v background -b none -p 20 -t mydomainame/f4.jpg mydomainame/cylindrical_image.jpg 2>&1", $array)
See my home page at the link below for usage of my scripts with PHP exec
exec("cylinderize -m vertical -v background -b none -p 20 -t mydomainame/f4.jpg mydomainame/cylindrical_image.jpg 2>&1", $array)
See my home page at the link below for usage of my scripts with PHP exec
-
- Posts: 11
- Joined: 2016-09-12T07:43:22-07:00
- Authentication code: 1151
Re: How to convert an image into cylinderical image usng imagemagic?
Thanks for the reply.
I used your command exec("cylinderize -m vertical -v background -b none -p 20 -t mydomainame/f4.jpg mydomainame/cylindrical_image.jpg 2>&1", $array) and it show me an error >> http://prntscr.com/dcn0jg
I used your command exec("cylinderize -m vertical -v background -b none -p 20 -t mydomainame/f4.jpg mydomainame/cylindrical_image.jpg 2>&1", $array) and it show me an error >> http://prntscr.com/dcn0jg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to convert an image into cylinderical image usng imagemagic?
Try duplicating one of my exact examples and see if it errors? Off hand I do not know what the issue might be.
What is your IM version and platform?
Did you follow all my instructions on my home page for using the script in a PHP exec command?
My guess is that you did not follow the instructions, especially about editing the script to tell it where IM convert exists or exporting the path to IM convert into your .profile file.
Did you also change the setting of dir to be dir="/tmp" rather than dir="."?
It is late for me tonight, but I think I see a potential oversight. The script may not be computing a default radius before it is needed. I will try looking in more detail tomorrow. But you can try adding -r radius. The radius must fit the half width of the object (coffee cup or whatever) or you must set it to some value. The default is 1/4 the size of the image. Try that and see if it works.
What is your IM version and platform?
Did you follow all my instructions on my home page for using the script in a PHP exec command?
My guess is that you did not follow the instructions, especially about editing the script to tell it where IM convert exists or exporting the path to IM convert into your .profile file.
Did you also change the setting of dir to be dir="/tmp" rather than dir="."?
It is late for me tonight, but I think I see a potential oversight. The script may not be computing a default radius before it is needed. I will try looking in more detail tomorrow. But you can try adding -r radius. The radius must fit the half width of the object (coffee cup or whatever) or you must set it to some value. The default is 1/4 the size of the image. Try that and see if it works.
-
- Posts: 11
- Joined: 2016-09-12T07:43:22-07:00
- Authentication code: 1151
Re: How to convert an image into cylinderical image usng imagemagic?
Hello ![Smile :)](./images/smilies/icon_smile.gif)
this is my script
<?php
$cmd="/data/xhosts/mydomain.com/http/cylinderize -m vertical -v background -b none -p 20 -t /data/xhosts/mydomain.com/http/sample.jpg /data/xhosts/mydomain.com/http/cylinder.jpg 2>&1";
exec($cmd, $array);
echo "<pre>";print_r($array);
exit;
?>
which gives this error >> http://prnt.sc/dcn0jg
![Smile :)](./images/smilies/icon_smile.gif)
this is my script
<?php
$cmd="/data/xhosts/mydomain.com/http/cylinderize -m vertical -v background -b none -p 20 -t /data/xhosts/mydomain.com/http/sample.jpg /data/xhosts/mydomain.com/http/cylinder.jpg 2>&1";
exec($cmd, $array);
echo "<pre>";print_r($array);
exit;
?>
which gives this error >> http://prnt.sc/dcn0jg
-
- Posts: 11
- Joined: 2016-09-12T07:43:22-07:00
- Authentication code: 1151
Re: How to convert an image into cylinderical image usng imagemagic?
Thanks for the suggestion "But you can try adding -r radius. ". it works for me. I just added radius in the above script and it works for me.
It is difficult to detect that the radius -r parameter is important in php script exec() , as it works in shell command properly without using -r paramter. THe script works for me after adding parameter -r >>
$cmd="/data/xhosts/mydomain.com/http/cylinderize -m vertical -r 400 -v background -b none -p 20 -t /data/xhosts/mydomain.com/http/sample.jpg /data/xhosts/mydomain.com/http/cylinder.jpg 2>&1";
exec($cmd, $array);
see screenshot >> http://prntscr.com/dcnd57
THANKS AGAIN
![Smile :)](./images/smilies/icon_smile.gif)
It is difficult to detect that the radius -r parameter is important in php script exec() , as it works in shell command properly without using -r paramter. THe script works for me after adding parameter -r >>
$cmd="/data/xhosts/mydomain.com/http/cylinderize -m vertical -r 400 -v background -b none -p 20 -t /data/xhosts/mydomain.com/http/sample.jpg /data/xhosts/mydomain.com/http/cylinder.jpg 2>&1";
exec($cmd, $array);
see screenshot >> http://prntscr.com/dcnd57
THANKS AGAIN
![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to convert an image into cylinderical image usng imagemagic?
I am not sure why it would work in a terminal without r and fails in PHP exec. But I will look again tomorrow at the code.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to convert an image into cylinderical image usng imagemagic?
I cannot make the script fail without -r. However, I switched some code around where I thought it should properly be located. So give the new version a try.
-
- Posts: 11
- Joined: 2016-09-12T07:43:22-07:00
- Authentication code: 1151
Re: How to convert an image into cylinderical image usng imagemagic?
Hello ![Smile :)](./images/smilies/icon_smile.gif)
My cylindrical image is ready. But the upper area of lamp is transparent and I want to fill the area by same image. Just like when we physically round an object . Just like this => http://prntscr.com/dg1s4l
![Smile :)](./images/smilies/icon_smile.gif)
My cylindrical image is ready. But the upper area of lamp is transparent and I want to fill the area by same image. Just like when we physically round an object . Just like this => http://prntscr.com/dg1s4l
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to convert an image into cylinderical image usng imagemagic?
Sorry, my script won't currently do that.
-
- Posts: 3
- Joined: 2019-03-03T03:46:13-07:00
- Authentication code: 1152
Re: How to convert an image into cylinderical image usng imagemagic?
Hello When I run the cylinderize script it gives the error shown in the screenshot.
https://screenshot.net/4rwdet3
https://screenshot.net/4rwdet3
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to convert an image into cylinderical image usng imagemagic?
That does not tell me much and I have never seen that type of error. It appears that you are on a PC. My script does not work for normal Windows. It needs Windows 10 unix or Windows with Cygwin. Can you tell me what your IM version is and also what type of Unix system you are using. If on Windows Unix of some type. See my home page for instructions for using my scripts with Windows Unix at http://www.fmwconcepts.com/imagemagick/index.php. Also see the top most post on here in this forum viewtopic.php?f=26&t=25910
-
- Posts: 3
- Joined: 2019-03-03T03:46:13-07:00
- Authentication code: 1152
Re: How to convert an image into cylinderical image usng imagemagic?
Hi I am not on PC with Windows I am on Ubuntu 16. My IM version is 6.8. The Screenshot shows the command line with command being run and the output is shown. The script aborts on line 933 not sure why.