CarrierWave not resizing

2019-08-30 18:54发布

I'm using carrierwave with ImageSorcery in order to handle image uploads and thumbs creation. Everything worked really well until I realized my thumbs were saved without being resized =/

I don't know what causes this and didn't find any solution working for me on the interwebs.

I'm using Ruby 2.0.0p247 and here's my code :

source 'https://rubygems.org'
gem 'thin'

gem 'rails', '4.0.0'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'

gem 'jquery-rails'
gem 'fancybox2-rails', '~> 0.2.4'
gem 'dropzonejs-rails', '~> 0.4.9'

gem 'image_sorcery'
gem 'carrierwave'
gem 'carrierwave-imagesorcery'

gem 'unicode_utils'
gem 'protected_attributes'

gem "font-awesome-rails"

group :development, :test do
    gem 'meta_request'
    gem 'sass-rails', '~> 4.0.0'
    gem 'better_errors'
    gem 'binding_of_caller'
    gem 'pry'
end

The uploader :

# encoding: utf-8

class ImageUploader < CarrierWave::Uploader::Base

    include CarrierWave::ImageSorcery

    storage :file

    def store_dir
        "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end

    version :thumb do
        process :resize_to_limit => [210, 222]
    end

    def extension_white_list
        %w(jpg jpeg gif png)
    end
end

I have already found posts like MiniMagick and Carrierwave not resizing but none answered my problem :/

If anyone has an idea or had the same problem I'd be really glad to discuss it.

Thanks :)

0条回答
登录 后发表回答