Class: Imagery::SvgGenerator::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/imagery/svg_generator.rb

Instance Method Summary (collapse)

Constructor Details

- (Converter) initialize(blob)

A new instance of Converter



29
30
31
# File 'lib/imagery/svg_generator.rb', line 29

def initialize(blob)
  @blob = blob
end

Instance Method Details

- (Object) svg_to_png

Raises:

  • (TransformationError)


33
34
35
36
37
38
# File 'lib/imagery/svg_generator.rb', line 33

def svg_to_png
  logger.info "** rasterize svg to png"
  result = popen("rsvg-convert")
  raise TransformationError, "Data was not a valid SVG image." unless $? == 0
  result
end