lib/rabbit/image/svg.rb in rabbit-2.1.9 vs lib/rabbit/image/svg.rb in rabbit-2.2.0

- old
+ new

@@ -10,10 +10,14 @@ unshift_loader(self) class << self def match?(filename) File.open(filename) do |f| - /<svg|<!DOCTYPE\s+svg/ =~ f.read(200) + begin + /<svg|<!DOCTYPE\s+svg/ =~ f.read(200) + rescue EncodingError + false + end end end end def draw(canvas, x, y, params={})