version :thumb do process :resize_to_limit => [260,192] process :convert => :jpg process :set_content_type end def set_content_type(*args) self.file.instance_variable_set(:@content_type,"image/jpeg") end
但是当PDF文件是多页面时,它会生成一个jpg文件中所有页面的缩略图.有没有办法生成缩略图仅第一页?
def cover manipulate! do |frame,index| frame if index.zero? end end process :cover