Hi, I am using imagemagick and rmagick for image manipulation.... imagemagick version-6.4.4 rmagick 2.7 I need to create a thumbnail. img = Magick::Image.read(org_img_path)[0] img.crop_resized(width,height) img.write(new_image_path) when i used this piece of code in console its cropping correctly...when i used inside model or lib or controller its not working. but if i use crop_resized! it is working but i need to maintain aspect ratio for that image. If someone knows solutin for this problem kindly help me with regards shiva -- 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 -~----------~----~----~----~------~----~------~--~---
Shiva Kumaran wrote:> Hi, > I am using imagemagick and rmagick for image manipulation.... > > imagemagick version-6.4.4 > rmagick 2.7 > > I need to create a thumbnail. > > img = Magick::Image.read(org_img_path)[0] > img.crop_resized(width,height) > img.write(new_image_path) > > > when i used this piece of code in console its cropping correctly...when > i used inside model or lib or controller its not working. > > but if i use crop_resized! it is working but i need to maintain aspect > ratio for that image. > > If someone knows solutin for this problem kindly help me > > with regards > shivaany method ending ''!'' will affect current object the remaining methods(except something like pop,shift) won''t affect current one if you want then use it img = Magick::Image.read(org_img_path)[0] img.crop_resized(width,height).write(new_image_path) you can ask this doublt to your colleague like ("najnaR ro iallihT".reverse) -- 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 -~----------~----~----~----~------~----~------~--~---
Pokkai Dokkai wrote:> Shiva Kumaran wrote: >> Hi, >> I am using imagemagick and rmagick for image manipulation.... >> >> imagemagick version-6.4.4 >> rmagick 2.7 >> >> I need to create a thumbnail. >> >> img = Magick::Image.read(org_img_path)[0] >> img.crop_resized(width,height) >> img.write(new_image_path) >> >> >> when i used this piece of code in console its cropping correctly...when >> i used inside model or lib or controller its not working. >> >> but if i use crop_resized! it is working but i need to maintain aspect >> ratio for that image. >> >> If someone knows solutin for this problem kindly help me >> >> with regards >> shiva > > any method ending ''!'' will affect current object > the remaining methods(except something like pop,shift) won''t affect > current one > if you want > then use it > > img = Magick::Image.read(org_img_path)[0] > img.crop_resized(width,height).write(new_image_path) > > you can ask this doublt to your colleague like ("najnaR ro > iallihT".reverse)ok thanks mokkai. wht is the difference bwn wht i wrote and wht u have send eg: img.crop_resized(width,height) img.write(new_image_path) and wht u have sent img.crop_resized(width,height).write(new_image_path) -- 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 -~----------~----~----~----~------~----~------~--~---
Shiva Kumaran wrote:>> img = Magick::Image.read(org_img_path)[0] >> img.crop_resized(width,height).write(new_image_path) >> >> you can ask this doublt to your colleague like ("najnaR ro >> iallihT".reverse) > > ok thanks mokkai. wht is the difference bwn wht i wrote and wht u have > send > > eg: > img.crop_resized(width,height) > img.write(new_image_path) > > and wht u have sent > > img.crop_resized(width,height).write(new_image_path)it is simple user@ubuntu:~$ ruby -e "p ''usarA iallihT ksA''.reverse" -- 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 -~----------~----~----~----~------~----~------~--~---
Shiva Kumaran wrote:> Pokkai Dokkai wrote: >> Shiva Kumaran wrote: > eg: > img.crop_resized(width,height) > img.write(new_image_path) > > and wht u have sent > > img.crop_resized(width,height).write(new_image_path)hey guys don''t get angry on me if u & ur tl don''t know then you can ask to others(who know). don''t discourge other guys who know better then you (like Ranjan and Thillai) give respect to others also, as a good developer i know something about that naskitasky politics in ur ''etaroproc".reverse this is my small advice "sorry for my distrub" if "i am wrong" by me(mokkai) -- 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 -~----------~----~----~----~------~----~------~--~---
Mr. Thanniarasu wht''s ur problem........... -- 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 -~----------~----~----~----~------~----~------~--~---
ghost rider wrote:> > Mr. Thanniarasu wht''s ur problem...........who is that joker ? -- 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 -~----------~----~----~----~------~----~------~--~---
Sniper Abandon wrote:> ghost rider wrote: >> >> Mr. Thanniarasu wht''s ur problem........... > > who is that joker ?no reply... r u there ? | r u sleeping....? -- 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 -~----------~----~----~----~------~----~------~--~---