Merge pull request #660 from bitgangsta/fix_svg

Fixing automatic_image_sizes to eliminate warnings on vector images
This commit is contained in:
Thomas Reynolds 2012-11-06 14:41:38 -08:00
commit 3f1fa496b2

View file

@ -30,7 +30,11 @@ module Middleman
# @param [Hash] params
# @return [String]
def image_tag(path, params={})
if !params.has_key?(:width) && !params.has_key?(:height) && !path.include?("://")
params[:supported_extensions] ||= %w(.png .jpg .jpeg .bmp .gif)
if !params.has_key?(:width) && !params.has_key?(:height) && !path.include?("://") &&
params[:supported_extensions].include?(File.extname(path).downcase)
params[:alt] ||= ""
real_path = path