CarrierWave not resizing

梦想的初衷 提交于 2019-12-11 14:14:09

问题


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 :)

来源:https://stackoverflow.com/questions/20678894/carrierwave-not-resizing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!