ImageMagick:在添加到目标图像之前变换图层

时间:2013-07-23 06:17:03

标签: php imagemagick thumbnails transform

我正在尝试使用命令行工具使用-composite旋转并将图像添加到最终图像。 它确实生成图像,但是已经通过的各个图像不会旋转。 -affine -transform-composite可以一起工作吗?

以下是代码段:

$command1 = "/usr/bin/convert";
$size = " -size $size xc:white ";

$query = "SELECT * FROM ....";
$qry_result = mysql_query($query) or die(mysql_error());
$images_for_thumb="";
// Insert a new row in the table for each person returned
while($row = mysql_fetch_array($qry_result)){
    $cir =  $row[image_name];   

    if ($row[obj_w]>0) 
    {
    $c = cos((floatval($row[obj_r])*3.14)/180.0);
    $s = sin((floatval($row[obj_r])*3.14)/180.0);

    $images_for_thumb = $images_for_thumb . "../$cir -geometry $row[obj_w]x$row[obj_h]+$row[obj_x]+$row[obj_y] -affine $c,$s,-$s,$c,0,0 -transform -composite ";

    }
}   

$fileName=$play_id . '-' . $time_start . '.png';
$c1 = $command1 . $size . $images_for_thumb . " -resize 14% -bordercolor black -border 1x1 -gravity center ../thumb/" . createPath($fileName, "");

0 个答案:

没有答案