Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sharshenov/minimagick-clip
Clipping images with minimagick & mask file
https://github.com/sharshenov/minimagick-clip
Last synced: 7 days ago
JSON representation
Clipping images with minimagick & mask file
- Host: GitHub
- URL: https://github.com/sharshenov/minimagick-clip
- Owner: sharshenov
- License: mit
- Created: 2016-06-19T04:53:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-19T06:01:27.000Z (over 8 years ago)
- Last Synced: 2025-01-14T09:58:43.451Z (about 1 month ago)
- Language: Ruby
- Size: 4.88 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MiniMagick cliping images with mask file
[![Gem Version](https://badge.fury.io/rb/mini_magick_clip.svg)](http://badge.fury.io/rb/mini_magick_clip)
Use mask file to clip images with minimagick.
![MiniMagick clip with mask](https://s3-us-west-2.amazonaws.com/sharshenov/minimagick-clip.png)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mini_magick_clip'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install mini_magick_clip
## Usage
Carrierwave example:
```ruby
class AvatarUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
include MiniMagickClipprocess convert: 'png'
version :thumb do
process resize_to_fill: [210, 210]
process mask: Rails.root.join('app/uploaders/t-shirt-mask.png')
enddef filename
if original_filename
[
model.username,
"png"
].join(".")
end
end
end
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/sharshenov/minimagick-clip.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).