<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test_rails/compex_pic_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -170,11 +170,11 @@ module HasImage
     end
     
     def width
-      minimagick[:width]
+      self[:width] || minimagick[:width]
     end
     
     def height
-      minimagick[:height]
+      self[:height] || minimagick[:height]
     end
     
     def minimagick
@@ -210,15 +210,23 @@ module HasImage
     def update_images
       return if storage.temp_file.blank?
       remove_images
-      update_attribute(has_image_options[:column], storage.install_images(self))
+      populate_attributes
     end
 
     # Processes and installs the image and its thumbnails.
     def install_images
       return if !storage.temp_file
-      update_attribute(has_image_options[:column], storage.install_images(self))
+      populate_attributes
     end
     
+    def populate_attributes
+      send(&quot;#{has_image_options[:column]}=&quot;, storage.install_images(self))
+      self[:width] = minimagick[:width] if self.class.column_names.include?('width')
+      self[:height] = minimagick[:height] if self.class.column_names.include?('height')
+      save!
+    end
+    private :populate_attributes
+    
     # Gets an instance of the underlying storage functionality. See
     # HasImage::Storage.
     def storage</diff>
      <filename>lib/has_image.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,9 @@ module HasImage
           `identify #{arg.respond_to?(:path) ? arg.path : arg.to_s}`
           $? == 0
         end
-      end    
+      end
+      
+      
     end
 
     # The constuctor should be invoked with the options set by has_image.</diff>
      <filename>lib/has_image/processor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,5 +5,11 @@ ActiveRecord::Schema.define(:version =&gt; 1) do
     t.datetime :created_at
     t.datetime :updated_at
   end
-
+  
+  create_table 'complex_pics', :force =&gt; true do |t|
+    t.string :filename
+    t.integer :width, :height
+    t.timestamps
+  end
+  
 end</diff>
      <filename>test_rails/schema.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fb9a4d609387f8e33151042bbca0e0d1f812db83</id>
    </parent>
  </parents>
  <author>
    <name>Gerrit Kaiser</name>
    <email>gerrit@gerritkaiser.de</email>
  </author>
  <url>http://github.com/norman/has_image/commit/d7b057604aa0399afd51c89c3199644b860a2aea</url>
  <id>d7b057604aa0399afd51c89c3199644b860a2aea</id>
  <committed-date>2008-10-21T23:55:08-07:00</committed-date>
  <authored-date>2008-10-21T23:55:08-07:00</authored-date>
  <message>use width/height columns to store dimensions if they&#8217;re present in the model</message>
  <tree>4130a8d2ba3685963f48c5b3fa0696bd782c078b</tree>
  <committer>
    <name>Gerrit Kaiser</name>
    <email>gerrit@gerritkaiser.de</email>
  </committer>
</commit>
