<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>&lt;pre&gt;&lt;code class="ruby"&gt;

def set_image_dimensions
  if @image.width.blank? || @image.height.blank?
    ImageScience.with_image("#{RAILS_ROOT}/public/" &lt;&lt; @image.public_filename) do |img|
      @image.height = img.height
      @image.width = img.width
    end
    @image.update_attribute('height',@image.height)
    @image.update_attribute('width',@image.width)
  end
end
&lt;/code&gt;&lt;/pre&gt;

Is anyone doing it differently ?  Has this been addressed ?

Comments welcome.

Hamza

</body>
  <category-id type="integer">1</category-id>
  <comments-count type="integer">26</comments-count>
  <created-at type="datetime">2007-05-18T00:00:00Z</created-at>
  <id type="integer">22</id>
  <live type="boolean">true</live>
  <slug nil="true"></slug>
  <summary>As I mentioned earlier, when working with attachment_fu and image science the width and height of thumbnails were not being set correctly.  So here is a method that I use to make sure that the data is set. </summary>
  <title>attachment_fu Thumbnail Size</title>
  <updated-at type="datetime">2008-12-14T19:37:01Z</updated-at>
  <user-id type="integer">1</user-id>
</post>
