In the below code , iam trying to output a image through imagemagick processing. Here, iam applying a border radius to the input image. I am getting the output when iam saving a image to the output folder with the following code.
<?php
$input = "input.png";
$s = 10;
$t = 10;
$size = getimagesize ( $input );
$output = $outputfolder . $outputname;
exec( "convert -size " . $size [0] . "x" . $size [1] . " xc:none -fill -transparent
-draw \"roundRectangle 0,0 " . $size [0] . "," . $size [1] . " $s,$t\" " . $input .
" -compose SrcIn -composite " . $output . " " );
?>
I want a output which has not been saved to the local folder but want to display the output with the header content type. Iam using passthru to do this.But iam not getting the output. I am trying with the following code
<?php
$input = "input.png";
header("Content-Type: image/png");
$size = getimagesize ( $input );
$s = 10;
$t = 10;
$cmd = " - size " . $size [0] .
"x" . $size [1] . " xc:none -fill -transparent -draw
\"roundRectangle 0,0 " .
$size [0] . "," . $size [1] . " $s,$t\" " .
" -compose SrcIn -composite" .
" -tile - $input";
passthru("convert $cmd PNG :-")
?>
I think i am wrong with the command i used. Please help me in this. Thanks in advance.