0

I am trying to do image manipulation as process to add some text to my app. The effect I'm looking for is : adding text to image, after saving. The problem I'm dealing here is I get error: uninitialized constant PhotoUploader::Draw.

photo_uploader.rb

process :poster

def poster
 manipulate! do |source|
  txt = Draw.new
  txt.family
  txt.pointsize = 12
  txt.gravity = Magick::SouthGravity
  txt.stroke = "#000000"
  title = Demot.last.title
  source = source.resize_to_fill(400, 400).border(10, 10, "black")
  source.annotate(txt, 0, 0, 0, 40, title)

end

end

Community
  • 1
  • 1
Przemek Mroczek
  • 357
  • 1
  • 11

1 Answers1

4

Change to

txt = Magick::Draw.new
paxer
  • 961
  • 10
  • 17