In one of my latest projects i was using the attachement_fu plugin to handle image uploads.
The attachement_fu plugin enables the option to select an image processor engine between ImageScience, Rmagick add MiniMagick:
- Rmagick
Kinda bulky, leaking but fully functional - MiniMagick
Simple version of Rmagick, simple and small. - ImageSceince
Small, nice, and quick.
sudo gem install mini_magick
and added a specific :processor option to my Logo model.
has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 2.megabytes,
:resize_to => 'x100',
:processor => :mini_magick
but when i was uploading an image, i was was expecting it to be resized based on the options i specified in the model. imagine how surprised i was when i found out that the image is not being resized.
checking the log found the following error:
Exception working with image: ImageMagick command (identify "/var/folders/Bv/Bvbna8-OH548ZWju8naF4U+++TI/-Tmp-/minimagick11451-0") failed: Error Given 32512
Googling it didn't help me much (except from finding other people with the same problem), so i decided to switch to ImageScience instead (RMagick is out of the question of course).
sudo gem install image_science
this will include all most all dependencies, the freeImage dependency is also needed.
us mac/darwin users can simply use port:
sudo port selfupdate
sudo port install freeimage
now change the processor in the model
has_attachment :content_type => :image,
:storage => :file_system,
:max_size => 2.megabytes,
:resize_to => 'x100',
:processor => :image_science
and now it's working. yeah!.
1 comments:
November 30, 2008 at 5:34 PM
This is mostly a f@@@@ bug with the OS X port I also encounter. And a good reason to drop ImageMagick for "just" resizing.
Post a Comment