-
-
Save yaoyi/21735062bfcf5672898e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this in config/initializers/carrierwave.rb | |
module CarrierWave | |
module MiniMagick | |
def quality(percentage) | |
manipulate! do |img| | |
img.quality(percentage) | |
img = yield(img) if block_given? | |
img | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImageUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
process :quality => 85 | |
version :medium do | |
process :quality => 85 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment