Hi,
I need use some code from fred imagemagik example with php, the downloadable script is different.
any help please?
best regards.
how i can use the fred script with php?
-
- Posts: 44
- Joined: 2014-11-28T16:19:41-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how i can use the fred script with php?
Please clarify what you are trying to do and which script. My scripts are unix bash shell scripts and should work fine using PHP in a unix system. I do not know if they work on Windows with PHP.
What script?
Is this for commercial use?
What is your platform and version of Imagemagick?
Did you review my Pointers on my home page?
I do not understand about using parts of the code? Why not the whole script? What is different about my script from what you want to do?
If you need some free code, see Anthony's web pages at http://www.imagemagick.org/Usage/
What script?
Is this for commercial use?
What is your platform and version of Imagemagick?
Did you review my Pointers on my home page?
I do not understand about using parts of the code? Why not the whole script? What is different about my script from what you want to do?
If you need some free code, see Anthony's web pages at http://www.imagemagick.org/Usage/
Re: how i can use the fred script with php?
I believe Fred has instructions on his site. But you need to upload the script and CHMOD it to either 777 or 755 depending on your server setup - one will work and the other wont so you will know when it is correct. You then need to find the full path to the script on your server.
Then use some code like this:
You will have to fill in any other variables depending on the script you are using
Then use some code like this:
Code: Select all
// Where freds script is autotrim.sh and username is your server login name
exec(" /home/username/public_html/autotrim.sh zelda3_border2w.png fred.png ");
-
- Posts: 44
- Joined: 2014-11-28T16:19:41-07:00
- Authentication code: 6789
Re: how i can use the fred script with php?
thank for reply,
I found :
viewtopic.php?t=9631#p53156
part witch about exec() ,
i use exec() already but some of code in fred home page is ready to use, also those are amazing for work with imagemagick.
I try viewtopic.php?t=9631#p53156 and i hope that work.
i use the lasted version of imagemagick on my linux server and use php for run my codes.
one Q:
is exec(" /home/username/public_html/autotrim.sh zelda3_border2w.png fred.png "); safe to use?
best regards.
I found :
viewtopic.php?t=9631#p53156
part witch about exec() ,
i use exec() already but some of code in fred home page is ready to use, also those are amazing for work with imagemagick.
I try viewtopic.php?t=9631#p53156 and i hope that work.
i use the lasted version of imagemagick on my linux server and use php for run my codes.
one Q:
is exec(" /home/username/public_html/autotrim.sh zelda3_border2w.png fred.png "); safe to use?
best regards.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how i can use the fred script with php?
What is the latest version for your linux server? Please specify exactly the version number. If it is too old relative the current version 6.9.0.0, then the script may have problems running properly.mostafanastary wrote:thank for reply,
i use the lasted version of imagemagick on my linux server and use php for run my codes.
one Q:
is exec(" /home/username/public_html/autotrim.sh zelda3_border2w.png fred.png "); safe to use?
best regards.
If you follow the instructions at http://www.fmwconcepts.com/imagemagick/index.php, you should have no trouble with your command if you want the default behavior. Otherwise, you need to specify arguments. You need to find the path to IM convert (type -a convert) and put that in the variable described on that page. Your images must be in the same location as the script if you use the command above. Otherwise, put the full path to your images and to the script. Be sure the change the dir="." to dir="/tmp" and set the permissions of the file to chmon u+x. Also be sure the file you download is named the same as you have above, that is autotim.sh. Add the .sh if it is not in the downloaded file.