File-column is a convenient plug-in used by the ROR application to process uploaded images. to crop images, you must install RMagic. Before installing RMagic, you must install ImageMagick or GraphicsMagic. After RMagic is installed, you can specify the image size as follows: file_column: image,: magick = & gt ;{: geometry = & gt; "100x100,
File-column is a convenient plug-in used by the ROR application to process uploaded images. to crop images, you must install RMagic. Before installing RMagic, you must install ImageMagick or GraphicsMagic.
After RMagic is installed, you can specify the image size using the following method:
File_column: image,: magick =>{: geometry => "100x100 "}
In this way, no matter how large the image is uploaded, it will be scaled up or down to X.
You can also generate a thumbnail using the following methods:
File_column: image,: magick =>{: versions =>{: thumb => "75x75 "}}
In this way, when you upload an image, you will also generate a thumbnail of 75x75.
RMagic Installation notes in Ubuntu 7.10:
$ Sudo apt-get install imagemagick
$ Sudo gem install rmagick -- include-dependencies
The error "configure: error: Can't install RMagick. Can't find Magick-config or GraphicsMagick-config program." appears. Follow the prompts to install the following package:
$ Sudo apt-get install libmagick9-dev
Install gem again:
$ Sudo gem install rmagick -- include-dependencies
Restart the Rails service. RMagic is installed successfully.