Showing posts with label RMagick. Show all posts
Showing posts with label RMagick. Show all posts

Sunday, July 31, 2011

Mac OSX Lion and RMagick

Error after update:
...
/Users/xxx/.rvm/gems/ruby-1.9.2-p290/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `require': dlopen(/Users/xxx/.rvm/gems/ruby-1.9.2-p290/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Library not loaded: /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libclparser.dylib (LoadError)
...
Solution:
Recompile all your gems: gem pristine --all
dydl errors are commonly associated with database drivers/bindings

Wednesday, November 25, 2009

Creating images from unicode text using rmagick

To create images from the unicode text, we can use the "encoding" method for the Draw object.
Example:
require "RMagick"
def show_textimg
bg = Magick::Image.new(120,20){self.background_color = "#9E9E9E"}
text = Magick::Draw.new
text.encoding = "Unicode"
text.text(23,14,"ドの半角⇔全角")
text.draw(bg)
bg.write "#{RAILS_ROOT}/public/images/text.jpg"
end
http://thinkingrails.blogspot.com/2009/08/creating-images-from-unicode-text-using.html