<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -170,18 +170,13 @@ module HasImage
     end
     
     def width
-      self[:width] || minimagick[:width]
+      self[:width] || storage.measure(absolute_path, :width)
     end
     
     def height
-      self[:height] || minimagick[:height]
+      self[:height] || storage.measure(absolute_path, :height)
     end
     
-    def minimagick
-      MiniMagick::Image.from_file(absolute_path)
-    end
-    private :minimagick
-    
     def image_size
       [width, height] * 'x'
     end
@@ -221,8 +216,8 @@ module HasImage
     
     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')
+      self[:width] = storage.measure(absolute_path, :width) if self.class.column_names.include?('width')
+      self[:height] = storage.measure(absolute_path, :height) if self.class.column_names.include?('height')
       save!
     end
     private :populate_attributes</diff>
      <filename>lib/has_image.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,6 @@ module HasImage
         end
       end
       
-      
     end
 
     # The constuctor should be invoked with the options set by has_image.
@@ -55,6 +54,11 @@ module HasImage
     end
     alias_method :resize, :process #Backwards-compat
     
+    # Gets the given +dimension+ (width/height) from the image file at +path+
+    def measure(path, dimension)
+      MiniMagick::Image.from_file(path)[dimension.to_sym]
+    end
+    
   private
     # operate on the image with MiniMagick
     # yields a MiniMagick::Image object</diff>
      <filename>lib/has_image/processor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -91,6 +91,11 @@ module HasImage
       @temp_file = nil
     end
     
+    # Measures the given dimension using the processor
+    def measure(path, dimension)
+      processor.measure(path, dimension)
+    end
+    
     # Gets the &quot;web&quot; path for an image. For example:
     #
     #   /photos/0000/0001/3er0zs.jpg</diff>
      <filename>lib/has_image/storage.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d7b057604aa0399afd51c89c3199644b860a2aea</id>
    </parent>
  </parents>
  <author>
    <name>Gerrit Kaiser</name>
    <email>gerrit@gerritkaiser.de</email>
  </author>
  <url>http://github.com/norman/has_image/commit/59f7224fcb6bb6bd8f170dc9cb00d57af04d33db</url>
  <id>59f7224fcb6bb6bd8f170dc9cb00d57af04d33db</id>
  <committed-date>2008-10-22T00:09:10-07:00</committed-date>
  <authored-date>2008-10-22T00:09:10-07:00</authored-date>
  <message>moved measuring into the processor where it belongs</message>
  <tree>e1ec3a318106a8c5022aab419f44da25cd000c71</tree>
  <committer>
    <name>Gerrit Kaiser</name>
    <email>gerrit@gerritkaiser.de</email>
  </committer>
</commit>
