exec w. imagemagick gives incomplete result

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Morten

    exec w. imagemagick gives incomplete result

    Hi. Trying to generate some images with imagemagick. The following
    works on
    the command line:

    /usr/local/bin/convert xc:yellow -resize 100x15! -gravity "West" -draw
    "text 0,0 'Path Two'"
    /Users/morten/Sites/cebra/images/a1a2e65dce30f01 861c60d0acb5287 c7.jpg

    But when running via PHP exec, the yellow box gets created alright,
    but the text doesn't
    show.

    exec($CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
    \"West\" -draw \"text 0,0 \'".$text."\' \" ".$file, $out, $err);

    Any suggestions?

    Thanks.

    Morten
  • Pedro Graca

    #2
    Re: exec w. imagemagick gives incomplete result

    Morten wrote:[color=blue]
    > But when running via PHP exec, the yellow box gets created alright,
    > but the text doesn't show.[/color]
    [color=blue]
    > exec($CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
    > \"West\" -draw \"text 0,0 \'".$text."\' \" ".$file, $out, $err);[/color]
    [color=blue]
    > Any suggestions?[/color]

    Try echo instead of exec

    echo $CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
    \"West\" -draw \"text 0,0 \'".$text."\' \" ".$file;
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    • Morten

      #3
      Re: exec w. imagemagick gives incomplete result

      Pedro Graca <hexkid@hotpop. com> wrote in message news:<brtb6g$74 nr4$1@ID-203069.news.uni-berlin.de>...[color=blue]
      > Morten wrote:[color=green]
      > > But when running via PHP exec, the yellow box gets created alright,
      > > but the text doesn't show.[/color]
      >[color=green]
      > > exec($CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
      > > \"West\" -draw \"text 0,0 \'".$text."\' \" ".$file, $out, $err);[/color]
      >[color=green]
      > > Any suggestions?[/color]
      >
      > Try echo instead of exec
      >
      > echo $CONVERT." -font helvetica xc:yellow -resize 100x15! -gravity
      > \"West\" -draw \"text 0,0 \'".$text."\' \" ".$file;[/color]

      And pasting the result of echo into a term works. I've found that this is
      highly likely to be due to imagemagick convert invokes another executable
      which is in /usr/local/bin and this path is not part of the PATH visible
      to PHP (according to phpinfo()). How do I add it?

      Thanks,

      Morten

      Comment

      Working...