Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
Crop stub
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticleo committed Aug 26, 2020
1 parent 829aa8b commit 8d17f8a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/gastly/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ def resize(width:, height:)
image.resize(dimensions)
end

# @param width [Fixnum] Crop width
# @param height [Fixnum] Crop height
# @param x [Fixnum] Crop x offset
# @param y [Fixnum] Crop y offset
def crop(width:, height:, x:, y:)
dimensions = "#{width}x#{height}+#{x}+#{y}"
image.crop(dimensions)
end

# @param ext [String] Image extension
# @return [MiniMagick::Image] Instance
def format(ext)
Expand Down

0 comments on commit 8d17f8a

Please sign in to comment.