0
Image::Magick

system("convert $imageurl $new");
system("convert $new -geometry 480x360 -blur .8 -quality 100 $new");

system("convert $imageurl $new");
system("convert $new -resize 480x360 -blur .8 -quality 100 $new");

上記の両方が正常に機能しますが、ジオメトリとサイズ変更の間に目に見える違いは見られません。それを読んで、頭の上で、うまくいくので、ここに行くにつれて学びます。

注釈を付けるには、以下が正常に機能します。

my $image;
my $test_text="testies123"; 
$image=Image::Magick->new;
my $x=$image->Read(filename=>"$new");
$x=$image->Annotate(text=>"$test_text",font=>'Candice.ttf',fill=>'#5BADFF',pointsize=>'14',gravity=>'SouthEast', x=>5, y=>5);
$x=$image->Write(filename=>'new_file.jpg'); undef $image;

(上記の例の $vars は明らかに以前に宣言されています。)

私がやろうとしているのは、すべてを 1 つの短いルーチンにまとめることです。

お気に入り:

system("convert $new -geometry 480x360 -blur .8 -quality 100 -annotate -text testies123 -font Candice -fill blue -pointsize 14  -gravity SouthEast -x 5 -y 5 $new");

上記のいくつかのバリエーションを試し、system() を介して注釈を付けようとしましたが、これを理解できません。

おそらく、すべてを合わせたより良い方法がありますか?この老犬に別のトリックを教えてくれてありがとう。

4

1 に答える 1

1

-annotateオプションの引数をクリアするためにドキュメントを読むことができますhttp://www.imagemagick.org/script/command-line-options.php#annotate

system("convert $new -geometry 480x360 -blur .8 -quality 100 -font Candice -fill blue -pointsize 14  -gravity SouthEast -annotate +5+5 testies123 $new")
于 2011-03-16T08:11:31.590 に答える