How can I run imagemagick commands in php?

I need to bend the text and put it on top of another image. I received the code below from my site and did not work; someone please tell me how can i do this in php. My system will support imagemagick and its support.

convert (newmug1.jpg -thumbnail 200x200 -write mpr: image + delete) \ (-orient 20x red-background no label: "Cottenham horse show" -virtual pixel transparent-arc-shaped arc 120 -write mpr: arc + delete) \ mpr: image mpr: arc -gravity north -composite combination.jpg

Please help me

thank you and welcome

tismon

+4
source share
2 answers

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'); 
+7
source

Try using

 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 placeholders are populated using variables, variables like $resolution just go straight to the command, for example -r$resolution .

You can also find this site .

0
source

Source: https://habr.com/ru/post/1312536/


All Articles