Skip to content

Commit

Permalink
non destructive thumbnail search incase this image is referenced more…
Browse files Browse the repository at this point in the history
… than once on the same page
  • Loading branch information
parndt committed Sep 10, 2009
1 parent 2bc6036 commit 33db02c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/plugins/refinery/app/helpers/application_helper.rb
Expand Up @@ -41,8 +41,8 @@ def selected_page?(page)

def image_fu(image, thumbnail, options={})
begin
image_to_use = thumbnail.nil? ? image : image.thumbnails.reject!{|t| t.thumbnail != thumbnail.to_s}.first
image_tag image_to_use.public_filename, {:width => image_to_use.width, :height => image_to_use.height}.merge!(options)
image = image.thumbnails.collect {|t| t if t.thumbnail == thumbnail.to_s}.compact.first unless thumbnail.nil?
image_tag image.public_filename, {:width => image.width, :height => image.height}.merge!(options)
rescue
image_tag image.public_filename(thumbnail), options
end
Expand Down

0 comments on commit 33db02c

Please sign in to comment.