0

I'm trying to rotate and add images to a final image using -composite with command line tools. It does generate the image but the individual images which have been passed are not rotated. Can -affine -transform and -composite work together?

Here is the code snippet:

$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, "");
Reetika
  • 123
  • 1
  • 11
  • 1
    This should raise loads of Warnings because you are not quoting array keys. Start by fixing these and make sure you enabled error reporting: http://stackoverflow.com/questions/6575482/php-how-do-i-enable-error-reporting – Gordon Jul 23 '13 at 06:23
  • 1
    On a side note: [PHP has an extension for ImageMagick](http://php.net/manual/en/book.imagick.php) – Gordon Jul 23 '13 at 06:25
  • @Gordon I've edited the question a little. I checked and the image is being created with the smaller images drawn on top of a background but the individual(small) images are not rotated. – Reetika Jul 23 '13 at 06:49

0 Answers0