lib/smappy/marker.rb in smappy-0.0.2 vs lib/smappy/marker.rb in smappy-0.0.3

- old
+ new

@@ -1,7 +1,7 @@ require 'open-uri' -require 'rmagick' +require 'chunky_png' module Smappy class Marker < Location DEFAULT_IMAGE = File.expand_path('../../../markers/information_marker.png', __FILE__) @@ -13,27 +13,26 @@ super end def width - marker_image.columns + marker_image.width end def height - marker_image.rows + marker_image.height end def position_on_map(map) x, y = super [x + offset[0], y + offset[1]] end # UNTESTED: def marker_image - @marker_image ||= ( - data = open(image).read - Magick::Image.from_blob(data).first + @marker_image ||= ChunkyPNG::Image.from_datastream( + ChunkyPNG::Datastream.from_io(open(image)) ) end end end