Skip to content

aman9463/carrierwave-optimize-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

carrierwave-optimize-image

This gem allows you to compress lossless images with the help of ffmpeg library on carrierwave gem. This library is inspired from carrierwave-imageoptimizer.

Installation

Then add this line to your application's Gemfile:

gem 'carrierwave-optimize-image'

And then execute:

$ bundle

Or install it yourself as:

$ gem install carrierwave-optimize-image

Usage

To add image compression to your CarrierWave uploader, first include the module:

class MyUploader < CarrierWave::Uploader::Base
   include CarrierWave::OptimzeImage
  ...
end

Then apply to eacg versions via:

class TestUploader < CarrierWave::Uploader::Base
  ...
  process optimize: [level: 10]
end
Lossy optimization

Pass an optional level parameter to specific lossy image quality level (0-100), default is lossless level is 30. The lessel the value, the better the qaulity.

system requiremets

To use this gem ffmpeg library should be install on you system or ypu can follow the below steps to install it.

Ubuntu

sudo apt-get install ffmpeg

Mac OS

brew install ffmpeg 

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages