Bunu test etmedi, ama böyle, "convert_options" parametre kullanmak mümkün olmalıdır:
:convert_options => { :all => ‘-colorspace Gray’ }
Ben bizzat kendi işlemcisini kullanmak
https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/thumbnail.rb
göz at. Bu basit bir gri tonlama dönüşüm için% 100 gerekli olmayabilir
module Paperclip
# Handles grayscale conversion of images that are uploaded.
class Grayscale < Processor
def initialize file, options = {}, attachment = nil
super
@format = File.extname(@file.path)
@basename = File.basename(@file.path, @format)
end
def make
src = @file
dst = Tempfile.new([@basename, @format])
dst.binmode
begin
parameters = []
parameters << ":source"
parameters << "-colorspace Gray"
parameters << ":dest"
parameters = parameters.flatten.compact.join(" ").strip.squeeze(" ")
success = Paperclip.run("convert", parameters, :source => "#{File.expand_path(src.path)}[0]", :dest => File.expand_path(dst.path))
rescue PaperclipCommandLineError => e
raise PaperclipError, "There was an error during the grayscale conversion for #{@basename}" if @whiny
end
dst
end
end
end
, ama işe yarıyor: lib olarak
has_attached_file :logo,
:url => PaperclipAssetsController.config_url,
:path => PaperclipAssetsController.config_path,
:styles => {
:grayscale => { :processors => [:grayscale] }
}
: Modeli'nde
!
Maalesef sayesinde:
veya dilerseniz bağlantı ile
! – jyosephDönüştürme seçeneklerinde ': styles => {: grey =>" 450x250 "},: convert_options => {: grey =>" -blur 0x8 "}' 'dır. – Ben