class Image

Schema Information

Table name: images

id                 :integer          not null, primary key
type               :string(255)
resource_id        :integer
resource_type      :string(255)
image_file_name    :string(255)
image_content_type :string(255)
image_file_size    :integer
image_updated_at   :datetime
active             :boolean          default(FALSE)
created_at         :datetime
updated_at         :datetime
university_id         :integer

Public Class Methods

convert_options(px = 15) click to toggle source

Convert option for the image

# File app/models/image.rb, line 26
def self.convert_options(px = 15)
  trans = ""
  trans << " \\( +clone  -alpha extract "
  trans << "-draw 'fill black polygon 0,0 0,#{px} #{px},0 fill white circle #{px},#{px} #{px},0' "
  trans << "\\( +clone -flip \\) -compose Multiply -composite "
  trans << "\\( +clone -flop \\) -compose Multiply -composite "
  trans << "\\) -alpha off -compose CopyOpacity -composite "
end