« projects
Extended File_Column - Now with ImageScienceThis is an "extended" version of the file_column plugin for RubyOnRails. has been "extended" to include support for ImageScience as a processor for uploaded images. Usage is (practically) the same and is intended to be a drop-in replacement for the file_column plugin. To process your uploaded images with ImageScience instead of ImageMagick, define file_column in your model as normal. Instead of defining the image processing rules with :magick, use :science. ImageMagick IS STILL SUPPORTED in this plugin, but DO NOT attempt to use both processors at the same time within the same model. Bad things will likely happen. Model Example
validates_file_format_of :image, :in => ["gif", "jpg", "png"]
file_column :image,
:science => {
:versions => {
:avatar => { :size => "20x20", :name => "avatar"},
:thumb => { :size => "40x40", :name => "thumb"},
:small => { :size => "100x100", :name => "small"},
}
}
Important NoteSince ImageScience is NOT ImageMagick, it does not have the same support for clever dimensions, such as 500x500!, 250>, etc. The :size parameter MUST be explicitly defined as WIDTHxHEIGHT. This plugin also makes use of the IrregularScience mixin which provides support for cropping and resizing to an exact width and height. Installation1. Install ImageScience, which depends on FreeImage 2. Place the contents of this archive in your vendor/plugins/ directory. 3. See the example above for hooking it into your model. Known IssuesAs of this writing, this plugin is very untested. It does not support many variations of dimensions (gravity, etc), only exact cropped/resizing is available. There are no tests included as of yet. Download the extended File_Column plugin |
|
| Copyright © 2004-2008 devtwo software |