# File lib/mini_magick/image.rb, line 82 def self.open(path_or_url, ext = nil, options = {}) options, ext = ext, nil if ext.is_a?(Hash) ext ||= if File.exist?(path_or_url) File.extname(path_or_url) else File.extname(URI(path_or_url).path) end ext.sub!(/:.*/, '') # hack for filenames or URLs that include a colon Kernel.open(path_or_url, "rb", options) do |file| read(file, ext) end end