Title: [1050] trunk/image_voodoo/lib/image_voodoo.rb: Make scale and thumbnail work properly
Revision
1050
Author
enebo
Date
2008-07-18 23:41:01 -0400 (Fri, 18 Jul 2008)

Log Message

Make scale and thumbnail work properly

Modified Paths


Diff

Modified: trunk/image_voodoo/lib/image_voodoo.rb (1049 => 1050)


--- trunk/image_voodoo/lib/image_voodoo.rb	2008-07-17 20:50:57 UTC (rev 1049)
+++ trunk/image_voodoo/lib/image_voodoo.rb	2008-07-19 03:41:01 UTC (rev 1050)
@@ -123,12 +123,8 @@
     l, r = half, half + height if width > height
     t, b = half, half + width if height > width
 
-    with_crop(l, t, r, b) do |image|
-      image.thumbnail(size) do |thumb|
-        target = ImageVoodoo.new target
-        block_given? ? yield(target) : target
-      end
-    end
+    target = with_crop(l, t, r, b).thumbnail(size)
+    block_given? ? yield(target) : target
   end
 
   #
@@ -212,10 +208,8 @@
   def scale(ratio)
     new_width, new_height = (width * ratio).to_i, (height * ratio).to_i
 
-    resize(new_width, new_height) do |image|
-      target = ImageVoodoo.new image
-      block_given? ? yield(target) : target
-    end
+    target = resize(new_width, new_height)
+    block_given? ? yield(target) : target
   end
 
   #
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to