ユーザーがアップロードする画像ファイルに、テキストとして議論を挿入したいと考えています。
以下のコードでは、動作しません。効果なしで画像を保存するだけです。
アップロードには「papaerclip」という gem を使用しています。
コメント.rb
#paperclip
has_attached_file :comment_icon,
:styles => {
:thumb=> "100x100>",
:small => "400x400>" },
:convert_options => {
:all => " -stroke '#000C' -strokewidth 2 -annotate 0 'Faerie Dragon' -stroke none -fill white -annotate 0 'Faerie Dragon'" }
この例のように、画像の下部にテキストを挿入するにはどうすればよいですか? comment.rb
は
どのように記述すればよいですか?
ImageMagick コード
convert dragon.gif -gravity south \
-stroke '#000C' -strokewidth 2 -annotate 0 'Faerie Dragon' \
-stroke none -fill white -annotate 0 'Faerie Dragon' \
anno_outline.jpg