trying to match my command line results with IMagick code
Posted: 2008-03-17T18:45:51-07:00
So, I have this command line that does exactly what I need, works perfectly (the actual values are being set in php):
When trying to accomplish this with Imagick, it's close, but as far as I can tell, the rotation works differently. Here is what I am using:
so what's happening is that if the rotation is greater than 0, the head is being composed funny, like distorted. Any idea how to match the output of the command line?
Code: Select all
$cmd2 = 'composite -compose src-over '.$headFile.' -matte -background none -rotate '.$rot.' -geometry '.$w.'x'.$h.$geomX.$geomY.' '.$ripPath .'/frame'.$i.'.jpg '.$outputDir.'/frame'.$i.'.jpg';
Code: Select all
$head = new Imagick( 'temp/frame' . $i . '.png' );
$frame->readImage( 'temp/frame' . $i . '.png' );
$tmpHead = $head->clone();
$tmpHead->thumbnailImage( $w, $h );
$tmpHead->rotateImage( 'transparent', $rot );
$frame->compositeImage( $tmpHead, Imagick::COMPOSITE_OVER, $x, $y );
$frame->writeImage( 'output/frame'.$i.'.jpg' );