How can I reduce the quality of an uploading image using Paperclip?
Try using convert_options.
has_attached_file :avatar,
:styles => { :thumb => '50x50#' },
:convert_options => { :thumb => '-quality 80' }
Paperclip: why, despite the reduction of quality, the size of an image does not change much?
The options should work fine, maybe your image just doesn't compress that well. Try to playing around with the convert
tool on the command tool (see docs) to see what helps. Also, it appears that paperclip can now take a :quality
option directly.
Rails reduce image size on some %
You can use the convert_options
has_attached_file :image,
:convert_options => { :thumb => '-quality 50' }
or you can try this one
has_attached_file :image => { :quality => :better }
Refer: Paperclip doc
How to reduce dpi to 72 for thumbs in paperclip, originals are 300 - rails 3.2
has_attached_file :uploadedPhoto,
:styles => {:portrait => "400x", :icon => "32x32#"},
:convert_options => {:portrait => '-strip -quality 60', :icon => '-strip -quality 60' }
upload image without losing quality in rails
Choosing between CarrierWave, Paperclip and Refile can be difficult at
times, but I would always recommend CarrierWave. It is the most
powerful and customizable of the three. It keeps your code organized
and clean, and is easy to test.Refile isn't ready for prime time yet as it is still experiencing
growth pains and has DoS issues, and Paperclip is fairly simplistic.
For more information please see this acrticle: Best Rails image uploader - Paperclip vs. Carrierwave vs. Refile
Related Topics
How to Install Ruby System-Wide Using Rbenv
How to Deal with a Page Which Fails to Load and Continue Testing in Watir-Webdriver
Ruby Gem Cucumber Ssl Error and Gem Sources
Brew Install Coreutils Failing 10.9.5 Osx
Twitter::Error::Unauthorized in Postscontroller#Create - Invalid or Expired Token
Why Is Autoload Failing to Load Files for Gems
Ruby 1.8: Hash#Sort Not Return Hash But Array (Better Way to Do This)
Can't Access the Dockerized App Launched from the Command Line from Outside
Open Xml File with Nokogiri Update Node and Save
How to Transform the Utf8 Chars to Iso8859-1
Rubymine 6.0.2, Unable to Debug
How to Push a Custom Gem to Heroku Master
How to Ignore File Types in a Web Crawler
Rails 3.2 Create a Form That's Used in the Footer of Every Page
Regex to Match Mm/Dd/Yyyy Hh:Mm:Ss Am or Pm
Heroku: Error Pushing Rails App to Heroku, Heroku Can't Find Rails App