0

I can take the command and have it echo the exact command and then run it in a shell and it works and generates the image. However when it is run though exec it does not work.

exec('convert ' . $from_path . ' -trim +repage -resize ' . ICON_SIZE . 'x' . ICON_SIZE . '> +repage -gravity center -background none -extent ' . ICON_SIZE . 'x' . ICON_SIZE . ' ' . $to_path);

echo 'convert ' . $from_path . ' -trim +repage -resize ' . ICON_SIZE . 'x' . ICON_SIZE . '> +repage -gravity center -background none -extent ' . ICON_SIZE . 'x' . ICON_SIZE . ' ' . $to_path;

I have simply copy and pasted the echo into the shell and the icon is generated. This is not the only exec in my program nor is it the only one I use with imagemagick. Any light you could shine on the issue would be appreciated.

Case
  • 4,244
  • 5
  • 35
  • 53
  • 1
    You probably need to escape the '>' with a '\'. – dlemstra Sep 12 '13 at 16:40
  • What is the output of exec? It doesn't work, ok, but it should be some output. Is convert in the path of your PHP configuration? Have you tried to use in exec the full path of convert? Are $from_path and $to_path well escaped? – Paolo Gibellini Sep 12 '13 at 20:24

0 Answers0