1) upload image (JPG/GIF/BMP/etc) to pre-designated path
2) auto resize the image and generate thumb image based on the
pre-defined width or length, keep ratio
3) best performance
Thanks for any recommendation.
--
Posted via http://www.ruby-forum.com/.
Investigate the acts_as_attachment plugin which has RMagick integration.
Delegate image manipulation to a seperate process. The easiest thing
to do in this case is simply run `convert` (imagemagick's command line
tool) on the image to generate a thumbnail.
-carl
--
EPA Rating: 3000 Lines of Code / Gallon (of coffee)
file_column does this, but if you do your own RMagick code, you must
call GC.start once your processing is complete.
On Feb 22, 11:34 am, "Carl Lerche" <carl.ler...@gmail.com> wrote:
> Do NOT use RMagick for image manipulation. Using RMagick in a rails
> process will cause the memory usage of each process to skyrocket. You
> will run into a lot of trouble later on (from personal experience).
>
> Delegate image manipulation to a seperate process. The easiest thing
> to do in this case is simply run `convert` (imagemagick's command line
> tool) on the image to generate a thumbnail.
>
> -carl
>
Thanks for saying this, Tom. I'm glad to see that this information is
getting out. It makes me sad when people say that RMagick "leaks" memory
when judicious use of GC.start would've solved their problem. If they
had emailed me I would've tried to help.
Not that I'm saying that it's impossible for RMagick to have a memory
leak. That would just be asking for trouble! I am saying that anybody
who thinks that RMagick has a memory leak should email me at rmagick AT
rubyforge DOT org to complain, or open a bug track on RubyForge. If I
know about a problem and can reproduce it, then I can fix it. I'd even
thank you for reporting the problem!
P.S. The RMagick documentation that Tom is referring to is a thread in
the RMagick Hints and Tips Forum on RubyForge:
http://rubyforge.org/forum/forum.php?thread_id=1374&forum_id=1618. If
you have a suggestion about a better way for me to promulgate this
information please let me know. Thanks!
Tim speaks the truth on both counts. RMagick doesn't leak memory if you
remember to call GC.start after each image-processing operation. AND
he's a very helpful person.
I've got an all-RMagick application at
It's been running for almost a year, on a shared host, and has no memory
issues.
--Al Evans