Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

image_compressor_for_carrierwave

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image_compressor_for_carrierwave

bundlerRubygems
Version
1.0.8
Version published
Maintainers
1
Created
Source

image_compressor_for_carrierwave

Based on piet gem https://github.com/albertbellonch/piet (changed to use pngquantizer as default for PNG images), On your CarrierWave uploader, include the extension:

class ImageUploader < CarrierWave::Uploader::Base
  ...
  include ImageCompressorForCarrierwave::CarrierWaveExtension
  ...
end

call the optimize method on the uploader:

class ImageUploader < CarrierWave::Uploader::Base
  ...
  process :optimize
  ...
end

passing parameters to encoders only used for the jpeg compression:

process optimize: [{ verbose: false, quality: 65 }]

Won't process images smaller than 500KB or as established in the ENV SKIP_COMPRESSION_IMAGE_FILE_IN_KB.

FAQs

Package last updated on 12 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts