lib/dragonfly/analysis/r_magick_analyser.rb in dragonfly-0.5.7 vs lib/dragonfly/analysis/r_magick_analyser.rb in dragonfly-0.6.0
- old
+ new
@@ -24,14 +24,21 @@
def number_of_colours(image)
rmagick_image(image).number_colors
end
alias number_of_colors number_of_colours
+
+ def format(image)
+ rmagick_image(image).format.downcase.to_sym
+ end
private
def rmagick_image(image)
Magick::Image.from_blob(image.data).first
+ rescue Magick::ImageMagickError => e
+ log.warn("Unable to handle content in #{self.class} - got:\n#{e}")
+ throw :unable_to_handle
end
end
end