I need 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/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Take a look at RMagic. Good for what your looking for. -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Surfman Joe Sent: Thursday, February 22, 2007 8:03 AM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] basic image process suggestion? I need 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/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Surfman Joe wrote:> I need > > 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.Investigate the acts_as_attachment plugin which has RMagick integration. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Another recommendation would be the file_column plug-in (http:// wiki.rubyonrails.org/rails/pages/HowToUseFileColumn). It is lighter (though not necessarily better) than acts_as_attachement and also uses RMagick for image manipulation. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On 2/22/07, Jeff <addstudios-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Another recommendation would be the file_column plug-in (http:// > wiki.rubyonrails.org/rails/pages/HowToUseFileColumn). It is lighter > (though not necessarily better) than acts_as_attachement and also uses > RMagick for image manipulation. > > > > >-- EPA Rating: 3000 Lines of Code / Gallon (of coffee) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The RMagick documentation is clear on this - you must invoke the Garbage collector manually after RMagick processing, as Ruby doesn''t track the RMagick memory used. 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...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 > > On 2/22/07, Jeff <addstud...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Another recommendation would be the file_column plug-in (http:// > > wiki.rubyonrails.org/rails/pages/HowToUseFileColumn). It is lighter > > (though not necessarily better) than acts_as_attachement and also uses > > RMagick for image manipulation. > > -- > EPA Rating: 3000 Lines of Code / Gallon (of coffee)--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Which rules out the memory problem and proves the use of actually reading documentation. :) -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Tom Fakes Sent: Thursday, February 22, 2007 6:49 PM To: Ruby on Rails: Talk Subject: [Rails] Re: basic image process suggestion? The RMagick documentation is clear on this - you must invoke the Garbage collector manually after RMagick processing, as Ruby doesn''t track the RMagick memory used. 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...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 > > On 2/22/07, Jeff <addstud...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Another recommendation would be the file_column plug-in (http:// > > wiki.rubyonrails.org/rails/pages/HowToUseFileColumn). It is lighter > > (though not necessarily better) than acts_as_attachement and also uses > > RMagick for image manipulation. > > -- > EPA Rating: 3000 Lines of Code / Gallon (of coffee)--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tom Fakes wrote:> The RMagick documentation is clear on this - you must invoke the > Garbage collector manually after RMagick processing, as Ruby doesn''t > track the RMagick memory used. > > file_column does this, but if you do your own RMagick code, you must > call GC.start once your processing is complete.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! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tim Hunter wrote:> Tom Fakes wrote: >> The RMagick documentation is clear on this - you must invoke the >> Garbage collector manually after RMagick processing, as Ruby doesn''t >> track the RMagick memory used. >> >> file_column does this, but if you do your own RMagick code, you must >> call GC.start once your processing is complete. > > 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.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 http://psitsnot.alevans.com It''s been running for almost a year, on a shared host, and has no memory issues. --Al Evans -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---