<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,12 +1,24 @@
 namespace :fleximage do
-  namespace :convert do
-    
-    # Find the model class
-    def model_class
-      raise 'You must specify a FLEXIMAGE_CLASS=MyClass' unless ENV['FLEXIMAGE_CLASS']
-      @model_class ||= ENV['FLEXIMAGE_CLASS'].camelcase.constantize
+  
+  # Find the model class
+  def model_class
+    raise 'You must specify a FLEXIMAGE_CLASS=MyClass' unless ENV['FLEXIMAGE_CLASS']
+    @model_class ||= ENV['FLEXIMAGE_CLASS'].camelcase.constantize
+  end
+  
+  desc &quot;Populate width and height magic columns from the current image store.  Useful when migrating from on old installation.&quot;
+  task :dimensions =&gt; :environment do
+    model_class.find(:all).each do |obj|
+      if obj.has_image?
+        img = obj.load_image
+        obj.update_attribute :image_width,  img.columns if obj.respond_to?(:image_width=)
+        obj.update_attribute :image_height, img.rows    if obj.respond_to?(:image_height=)
+      end
     end
-    
+  end
+  
+  namespace :convert do
+        
     def convert_directory_format(to_format)
       model_class.find(:all).each do |obj|
         </diff>
      <filename>tasks/fleximage_tasks.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>192ddcb95af577e9e390ea13b24fa27470844d32</id>
    </parent>
  </parents>
  <author>
    <name>Alex Wayne</name>
    <email>alex@beautifulpixel.com</email>
  </author>
  <url>http://github.com/Squeegy/fleximage/commit/38e089712fbf1afaf7809b43923b76572ad9882e</url>
  <id>38e089712fbf1afaf7809b43923b76572ad9882e</id>
  <committed-date>2008-06-09T21:22:12-07:00</committed-date>
  <authored-date>2008-06-09T21:22:12-07:00</authored-date>
  <message>Added fleximage:dimensions rake task for populating width and height magic columns.  [#3 state:resolved]</message>
  <tree>faaa0f949057ae0ee43677349ad9b057b171c4fe</tree>
  <committer>
    <name>Alex Wayne</name>
    <email>alex@beautifulpixel.com</email>
  </committer>
</commit>
