tismon
tismon

Reputation: 41

how can i run imagemagick commands in php?

i am in need of curving a text and place it over another image. i got the below mentioned code from their website and its not working; somebody please tell me how can i do this in php. My system will support imagemagick and its enabled..

convert ( newmug1.jpg -thumbnail 200x200 -write mpr:image +delete ) \ ( -pointsize 20 -fill red -background none label:"Cottenham horse show" -virtual-pixel transparent -distort arc 120 -write mpr:arc +delete ) \ mpr:image mpr:arc -gravity north -composite combined.jpg

please help me

thanks and regards

tismon

Upvotes: 4

Views: 5136

Answers (2)

craned
craned

Reputation: 3061

Try using this

exec("<full path to binary> '-dNOPAUSE' '-sDEVICE=jpeg' '-r<resolution>'
     '-g<dimensions' '-dUseCIEColor' '-dTextAlphaBits=4' '-dGraphicsAlphaBits=4'
     '-o<where you want the image stored>' '-dJPEGQ=<quality - I used 90>'
     '<pdf file to resize>'", $outputArray);

If the placeholders are filled in using variables, the variables, like $resolution, just go straight in to the command, like -r$resolution.

You might also find this website helpful.

Upvotes: 0

Lizard
Lizard

Reputation: 45032

Use the exec command - http://php.net/manual/en/function.exec.php

exec('convert ( newmug1.jpg -thumbnail 200x200 -write mpr:image +delete ) \ ( -pointsize 20 -fill red -background none label:"Cottenham horse show" -virtual-pixel transparent -distort arc 120 -write mpr:arc +delete ) \ mpr:image mpr:arc -gravity north -composite combined.jpg');

Upvotes: 7

Related Questions