Fixing image_tag helper so it only attempts to auto image sizes file extensions supported by FastImage. This can be overriden by passing param :supported_extensions into the image_tag helper.
This commit is contained in:
parent
0eb906efac
commit
8606fb4eba
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue