Skip to content

Commit

Permalink
If the geometry string is not passed then no thumbnail was requested …
Browse files Browse the repository at this point in the history
…so we can optimise that situation. (ht: djones pair programming)
  • Loading branch information
parndt committed Sep 20, 2010
1 parent ba5e981 commit a18d42e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vendor/refinerycms/core/lib/refinery/helpers/image_helper.rb
Expand Up @@ -24,8 +24,11 @@ def image_fu(image, geometry = nil, options={})
if image.present?
# call rails' image tag function with default alt tag.
# if any other options were supplied these are merged in and can replace the defaults.
# if the geomtry is nil, then we know the image height and width already.
image_tag(image.thumbnail(geometry).url, {
:alt => image.respond_to?(:title) ? image.title : image.image_name
:alt => image.respond_to?(:title) ? image.title : image.image_name,
:width => (image.image_width if geometry.nil?),
:height => (image.image_height if geometry.nil?)
}.merge(options))
end
end
Expand Down

0 comments on commit a18d42e

Please sign in to comment.