File Columnで画像に文字を挿入する。
magick_file_column.rb
*** 96,101 ****
--- 96,108 ----
i.resize(c, r)
end
end
+ if img_options[:annotate]
+ img = img.annotate(::Magick::Draw.new,
img_options[:annotate][:height].to_i,
img_options[:annotate][:width].to_i, img_options[:annotate][:x].to_i,
img_options[:annotate][:y].to_i, img_options[:annotate][:text]) do
+ img_options[:annotate][:attributes].each do |attr, value|
+ self.__send__(attr.to_s+"=", value)
+ end
+ end
+ end
ensure
img.write(dest_path) do
if img_options[:attributes]
<%= url_for_image_column(object, method, {:name => 'name', :annotate
=> {:text => "copyright", :attributes => {:gravity =>
::Magick::NorthGravity, :pointsize => 30, :fill => 'white'}}}) %>