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.

Reply via email to