Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean up comments

  • Loading branch information...
commit ef19e5727152ca9e79afd6a75cab9c947f68847c 1 parent ff0bed7
rmagick authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 examples/thumbnail.rb
View
8 examples/thumbnail.rb
@@ -4,6 +4,10 @@
puts <<END_INFO
This example demonstrates how to make a thumbnail of an image.
+An image is resized to the target size (retaining its original
+aspect ratio, of course) and then "mounted" on a square background
+with raised edges.
+
Usage:
ruby thumbnail.rb <filename <size>>
@@ -31,7 +35,9 @@
geom = "#{size}x#{size}"
-# Read the image and resize it.
+# Read the image and resize it. The `change_geometry' method
+# computes the new image geometry and yields to a block. The
+# return value of the block is the return value of the method.
img = Image.read(image)[0]
img = img.change_geometry(geom) { |cols, rows| img.thumbnail(cols, rows) }
Please sign in to comment.
Something went wrong with that request. Please try again.