Merge pull request #892 from mlorb/ml-sci-1215_v2

Make background gray for paperclip images [SCI-1215]
This commit is contained in:
mlorb 2017-11-23 17:32:09 +01:00 committed by GitHub
commit 9e7b75a880
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,8 +12,10 @@ class Asset < ActiveRecord::Base
has_attached_file :file,
styles: { large: [Constants::LARGE_PIC_FORMAT, :jpg],
medium: [Constants::MEDIUM_PIC_FORMAT, :jpg] },
convert_options: { medium: '-quality 70 -strip',
all: '-alpha remove' }
convert_options: {
medium: '-quality 70 -strip',
all: '-background "#d2d2d2" -flatten +matte'
}
validates_attachment :file,
presence: true,
size: {