No commit activity in last 3 years
No release in over 3 years
Simple dsl cover for carrierwave distinct processing declaration
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Carrierwave::Processor

ATTENTION! Now works only with rails >= 4.0.3 because of prepend support

Installation

To use with Bundler:

gem 'carrierwave-processor', '~> 1.0'

To require in non-rails

require 'carrierwave/processor'

Use

Now you can write groups of Carrierwave processors and versions outside of Uploader

Just use carrierwave_processor somewhere for processor declaration

carrierwave_processor :image do
  process :fix_exif_rotation
  process :convert => 'jpg'
  version :square do
    process :scale => [100, 100]
  end

  version :default do
    process :scale => [500, 500]
  end

  version :small do
    process :scale_to_fit => [100, 100]
  end
  
  def fix_exif_rotation
    manipulate! do |img|
      img.tap(&:auto_orient)
    end
  end
end

and use_processor in Uploader

class SomeUploader < CarrierWave::Uploader::Base
  use_processor :image, :if => :image?

  def image? m
   # ...
  end
end