The command
convert "page0006.tif" -background black -deskew 40% +repage -threshold 75%,80% -write mpr:image +delete ( mpr:image -crop 2020x200+0+1346 -scale 2020x1! -bordercolor black -border 1 -trim -write info: ) ( mpr:image -crop 200x2892+910+0 -scale 1x2892! -bordercolor black -border 1 -trim -write info: ) null:
Is working very well in Dos prompt, but same command don't work in PHP with exec (don't return the info:)
Thanks in advance.
Command wich work in DOS prompt but not in PHP
-
- Posts: 24
- Joined: 2012-01-10T05:19:23-07:00
- Authentication code: 8675308
- whugemann
- Posts: 289
- Joined: 2011-03-28T07:11:31-07:00
- Authentication code: 8675308
- Location: Münster, Germany 52°N,7.6°E
Re: Command wich work in DOS prompt but not in PHP
As far as I remember this problem has been discussed several times over here. It's probably that the PHP script is executed as a different user than you are usually logged on, probably under administrator rights. So you should test your code while being logged on as the administrator and see whether you run into the same problem. A workaround could be that you supply the full path to Convert, i.e. "%PROGRAMFILES%\ImageMagick...\convert.exe" instead of just calling Convert.
Wolfgang Hugemann
-
- Posts: 24
- Joined: 2012-01-10T05:19:23-07:00
- Authentication code: 8675308
Re: Command wich work in DOS prompt but not in PHP
It seems that the command is executed but the response is not coming. Same situation on Linux.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Command wich work in DOS prompt but not in PHP
try adding 2>&1 after the null:
You may also have to put the full path to convert
You may also have to put the full path to convert
-
- Posts: 24
- Joined: 2012-01-10T05:19:23-07:00
- Authentication code: 8675308
Re: Command wich work in DOS prompt but not in PHP
Thank you guys but is same situation. Any suggestions?
- whugemann
- Posts: 289
- Joined: 2011-03-28T07:11:31-07:00
- Authentication code: 8675308
- Location: Münster, Germany 52°N,7.6°E
Re: Command wich work in DOS prompt but not in PHP
Rather often, IM writes textual output to stderr rather than stdout, see http://www.imagemagick.org/Usage/windows/#pitfalls. Fred basically suggests to redirect this output. However, the output of info: is treated no other than other output "images", i.e. it is written to stdout.
If I were you, I would try a simpler command with info: output in PHP, in order to narrow the cause of the error.
If I were you, I would try a simpler command with info: output in PHP, in order to narrow the cause of the error.
Wolfgang Hugemann