image_tag() has :size option, but only takes height/width parameters. i want to be able to scale down the image by 50% because all my images are different sizes so i cannot be specific as image_tag() wants me to be. is there another RoR method i could use. note: i don''t want to resize my original images, i just want to be able to display them %50 smaller. hope i make sense. btw, great forum, very helpful! -- 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 -~----------~----~----~----~------~----~------~--~---
Are you meaning to resize the image to a percentage of it''s current size or as a percentage of it''s parent html black (like it would act if you just put percentages in the width and height attributes of the html img tag)? If you mean the latter, it''s just a matter of changing the way ''image_tag'' works so that you can feed it percentage as well as pixel values but if you mean the former, I''m not sure if you can do it without resorting to using rmagick (or similar) to find the width and height of the image and then halve them and use that in the ''image_tag'' size option. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thatcher.craig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jan-22 17:31 UTC
Re: resizing images for display only with image_tag()
you could use :height => "50%" and that should give you a proportionally scaled image. On Jan 22, 11:02 am, Leandro -- <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> image_tag() has :size option, but only takes height/width parameters. i > want to be able to scale down the image by 50% because all my images are > different sizes so i cannot be specific as image_tag() wants me to be. > is there another RoR method i could use. > > note: i don''t want to resize my original images, i just want to be able > to display them %50 smaller. hope i make sense. > > btw, great forum, very helpful! > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
idleFingers wrote:> Are you meaning to resize the image to a percentage of it''s current > size or as a percentage of it''s parent html black (like it would act > if you just put percentages in the width and height attributes of the > html img tag)? > > If you mean the latter, it''s just a matter of changing the way > ''image_tag'' works so that you can feed it percentage as well as pixel > values but if you mean the former, I''m not sure if you can do it > without resorting to using rmagick (or similar) to find the width and > height of the image and then halve them and use that in the > ''image_tag'' size option.i mean the latter -- 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 -~----------~----~----~----~------~----~------~--~---
thatcher.craig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> you could use :height => "50%" and that should give you a > proportionally scaled image. > > On Jan 22, 11:02�am, Leandro -- <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>using :height => "50%" and :width => "50%" worked like a charm. thank you! -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---