Class Logo
In: app/models/logo.rb
Parent: ActiveRecord::Base

Methods

Public Class methods

We override find to exclude the whole file contents (data, medium and thumb columns) from our result set.

The binary values should not be directly modified - Use self#from_blob instead.

Creates or updates the logo for the conference (specified as the second parameter) with the data received as a raw image as the first parameter. Creates the medium resolution and thumbnail versions as well - RMagick calculations will only be done when storing images, not when serving them.

RMagick will throw out a Magick::ImageMagickError if an invalid image is received

Public Instance methods

Medium resolution height: Stored in the ‘logo_medium_height’ SysConf entry (defaults to 500 if not set)

If the full image is smaller than the medium image, there is no point in having an amplified (and blurry) medium image - So give back the original size.

Medium resolution width (proportional to medium_height, preserving the original image‘s aspect ratio)

Thumbnail height: Stored in the ‘logo_thumb_height’ SysConf entry (defaults to 65 if not set)

Thumbnail width (proportional to thumb_height, preserving the original image‘s aspect ratio)

[Validate]