2

I want the functionality, but I can't for the life of me figure out what to do with the function described here: http://php.net/manual/en/imagick.montageimage.php . Googling has been unproductive so far.

I have read this http://www.imagemagick.org/Usage/montage/ and it seems easy enough in command line, but how do you specify the URLs to operate on in PHP?

I've also seen this, but it only makes me more confused since the guy doing it says it doesn't work for him. Imagick PHP Extension -- Montage help?

4

2 に答える 2

1

Imagickでそれを行う方法はわかりませんが、コマンドラインとphpでは次のようになります:

exec("montage balloon.gif medical.gif present.gif shading.gif montage.jpg");

変数を使用できます:

exec("montage $image1 $image2 $image3 $image4 $output");

ループを作成して連結できますか? 変数が次のようになるように、すべての画像を 1 つの変数にします。

$images = "$image1 $image2 $image3 $image4";

exec("montage $images $output");

exec( ) を使用した Imagemagick は、Imagick よりもはるかに単純であることがわかるでしょう。

画像の配列を使用できるかどうかはわかりません。

于 2012-05-24T18:22:55.047 に答える
0

私は同意します-phpメソッドmontageImage()は非常に混乱します。appendImages()代わりにを使用して別のアプローチを見つけました。

これは、PDFから生成されたpngを水平方向に並べて表示する方法です。

$im = new Imagick();
$im->readimageblob($blob);
$im->setiteratorindex(0); // start at first page (blob-specific)
$im->setImageFormat('png'); // jpg-artifacts - not thanks
$montage = $im->appendImages(false); // true will tile vertically

Imagick :: appendImages()-php.net

于 2012-11-02T14:05:47.510 に答える