Skip to content

Commit

Permalink
Tighten up reflections.
Browse files Browse the repository at this point in the history
Turns out there's already a method to do this.
  • Loading branch information
elliotcm committed Apr 3, 2012
1 parent 5b1b767 commit 9222433
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/sizeable/resizer.rb
Expand Up @@ -34,17 +34,9 @@ def reflect!
@image.format = 'PNG'
@content_type = @image.mime_type

mask = Magick::Image.new(@image.columns, @image.rows, Magick::GradientFill.new(0, 0, @image.columns, 0, "white", "black"))
mask.matte = false

reflection = @image.flip
reflection.matte = true

reflection.composite!(mask, Magick::CenterGravity, Magick::CopyOpacityCompositeOp)

components = Magick::ImageList.new
components << @image
components << reflection
components << @image.wet_floor(0.3)

@image = components.append(true)
end
Expand Down

0 comments on commit 9222433

Please sign in to comment.