Skip to content

Commit

Permalink
image_fu can no longer figure out the width and height because it add…
Browse files Browse the repository at this point in the history
…s a big performance issue. Closes GH-208. (ht: djones pair programming)
  • Loading branch information
parndt committed Sep 20, 2010
1 parent 5786539 commit ba5e981
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
5 changes: 3 additions & 2 deletions changelog.md
@@ -1,8 +1,9 @@
## 0.9.8.5 [unreleased]
* Fixed an issue with the engine generator that was putting a comma in the wrong place breaking the call to crudify. [Maarten Hoogendoorn](http://github.com/moretea)
* Fixed an issue with the engine generator that was putting a comma in the wrong place breaking the call to ``crudify``. [Maarten Hoogendoorn](http://github.com/moretea)
* Made the delete messages consistent. [Uģis Ozols](http://github.com/ugisozols)
* zh-CN was overriding en locale in core locale file, fixed. [Philip Arndt](http://github.com/parndt)
* ``zh-CN`` was overriding en locale in core locale file, fixed. [Philip Arndt](http://github.com/parndt)
* Changed verbiage from created to added, create to add as it describes it better for things like images. [Philip Arndt](http://github.com/parndt)
* ``image_fu`` no longer gives you the width and height of the image due to performance problems. [Philip Arndt](http://github.com/parndt) and [David Jones](http://github.com/djones)
* [See full list](http://github.com/resolve/refinerycms/compare/0.9.8.4...0.9.8.5)

## 0.9.8.4 [17 September 2010]
Expand Down
13 changes: 3 additions & 10 deletions vendor/refinerycms/core/lib/refinery/helpers/image_helper.rb
Expand Up @@ -22,17 +22,10 @@ def content_fu(content, thumbnail)
# <%= image_fu @model.image, '200x200' %> or with no thumbnail: <%= image_fu @model.image %>
def image_fu(image, geometry = nil, options={})
if image.present?
# call rails' image tag function with default alt, width and height options.
# call rails' image tag function with default alt tag.
# if any other options were supplied these are merged in and can replace the defaults.
thumbnail = image.thumbnail(geometry)
url = thumbnail.url
width = thumbnail.width
height = thumbnail.height

image_tag(url, {
:alt => image.respond_to?(:title) ? image.title : image.image_name,
:width => width,
:height => height
image_tag(image.thumbnail(geometry).url, {
:alt => image.respond_to?(:title) ? image.title : image.image_name
}.merge(options))
end
end
Expand Down

0 comments on commit ba5e981

Please sign in to comment.