I went through that list and tried them all.  rmagick, im_magick and 
mini_magick all didn't work for the .ico file I was using as a test case (I 
think whoever created it used some tool that doesn't produce a very readable 
format... or something).  rmagick and im_magick both just raised errors, while 
mini_magick offered the ability to use graphicsmagick under the hood... only to 
hang indefinitely instead of actually raising an error.  Dropping down to the 
command line, the tools (imagemagick and graphicsmagick) displayed the same 
behaviour (error vs hang).

The one that has worked for me, is the devil gem.  I hadn't heard of devil 
before, and the gem hasn't had a commit since October 2010, but it seems to 
"just work".

So there you have it... image processing tool choices are limited!  How hard 
could it be?!  (j/k)


On 28/06/2011, at 15:03, Andrew Boag wrote:

> 
> On 28/06/2011, at 14:53 pm, James Healy wrote:
> 
>> On 28 June 2011 14:48, Chris Corbyn <[email protected]> wrote:
>>> Does anybody know of any decent gems for working with images, other than
>>> RMagick, which seems quite old and unloved?
>> 
>> My image manipulation needs are modest, so I usually just manually
>> shell out to imagemagick.
>> 
>> Ugly maybe, but it works great and avoids the infamous memory leak
>> issues RMAgick had (has?).
> 
> Yeah, we used to do a similar thing in a php application (shell call 
> imagemagick functions from php). At the time the commandline tools offered a 
> lot more than the php libraries and we didn't need to read the image into php 
> memory.
> 
> It feels wrong but as long as you do some post-manipulation checks (with the 
> derived image) you should be fine.
> 
> Suggestions
> - move the raw image into tmp location with nice clean filename like 
> "/tmp/s12kd.jpg" instead of the original "This is a photo of my son!!! and & 
> blah.jpg" - when things get sent to the command line you don't want to get 
> caught out by funky file names and required escaping. You can always rename 
> it back in easy ruby land later.
> - check the result exit state of image magick command (however you do this in 
> ruby)
> - check that after the operation your outputted file looks meaningful. i.e. 
> it should exist && it should not have zero size etc. + anything else you can 
> think of.
> 
> Good luck!
> 
>> 
>> James
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby or Rails Oceania" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/rails-oceania?hl=en.
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rails-oceania?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to