def self.from_blob(data, conf)
conf = Conference.find_by_id(conf) if conf.is_a?(Fixnum)
logo = self.find(:first, :conditions => ['conference_id = ?', conf.id]) ||
self.new
logo.conference_id = conf.id
img = Magick::Image.from_blob(data)[0]
logo.width = img.columns
logo.height = img.rows
img.format = 'png'
logo[:data] = img.to_blob
med = img.thumbnail(logo.medium_width, logo.medium_height)
logo[:medium] = med.to_blob
thb = img.thumbnail(logo.thumb_width, logo.thumb_height)
logo[:thumb] = thb.to_blob
logo.save!
logo
end