Home Adding text to an image with Carrierwave and mini_magick
Reply: 0

Adding text to an image with Carrierwave and mini_magick

user465
1#
user465 Published in June 20, 2018, 11:05 pm

I'm trying to put text on an image via carrierwave and mini_magic. The code runs without erros, but the resulting image has no text on it.

version :text do
   process :put_text_stamp
end

def put_text_stamp
  manipulate! do |img|
    img.combine_options do |c|
      c.gravity 'Center'
      c.fill 'red'
      c.pointsize '22'
      c.draw "text 0,0 'TEXT'"
    end
    img = yield(img) if block_given?
    img
  end
end
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.335275 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO