Tim Connor
Feb 9th, 2010
The MiniMagickRasterizer converts SVG graphs to images using MiniMagick.
# File lib/scruffy/rasterizers/mini_magick_rasterizer.rb, line 10 def rasterize(svg, options={}) require 'mini_magick' image = MiniMagick::Image::from_blob(svg) image.format(options[:as]) do |cmd| cmd.background "#0000" # Transparent background end if options[:as] image.write(options[:to]) if options[:to] image.to_blob end