1

I hava uploader

class PimageUploader < CarrierWave::Uploader::Base

  include CarrierWave::MiniMagick

  storage :webdav if Rails.env.production?
  storage :file if Rails.env.development?

  version :preview do
    process resize_to_limit: [640, 640]
  end

  version :post do
    process resize_to_limit: [640, nil]
  end

  version :thumb do
    process resize_to_limit: [150, nil]
  end

end

Help me, I need to file with the extension gif make only thumb version.

1 Answers1

2

Try with something like:

  version :thumb, :if => :is_gif?

  protected
  def is_gif?(picture)
    picture.extension.to_s.downcase == 'gif'
  end
Aguardientico
  • 7,641
  • 1
  • 33
  • 33