Hi! I''m trying to make a site that can upload image files, but instead of posting each picture as their size, I''d rather post them in thumbnails (thank goodness html can warp images for you). I need to know how I can find a dimension of an image WITHOUT using a plugin (the server I am soon uploading this to most likely won''t have that plugin...and I don''t feel like forcing the administrators to download it). Are there any methods to take care of this? Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I found some TCL code to do that here: http://wiki.tcl.tk/757 It shouldn''t be too hard to port that to ruby. :-) - Tyler Taro <japtar10101-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi! I''m trying to make a site that can upload image files, but > instead of posting each picture as their size, I''d rather post them in > thumbnails (thank goodness html can warp images for you). I need to > know how I can find a dimension of an image WITHOUT using a plugin > (the server I am soon uploading this to most likely won''t have that > plugin...and I don''t feel like forcing the administrators to download > it). Are there any methods to take care of this? > > Thanks! > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Sep-17 22:23 UTC
Re: How to find the dimensions of an uploaded image
> Hi! I''m trying to make a site that can upload image files, but > instead of posting each picture as their size, I''d rather post them in > thumbnails (thank goodness html can warp images for you). I need to > know how I can find a dimension of an image WITHOUT using a plugin > (the server I am soon uploading this to most likely won''t have that > plugin...and I don''t feel like forcing the administrators to download > it). Are there any methods to take care of this?This will work for most jpegs... http://pastie.caboo.se/98119 Don''t remember where I got it... probably off of pastie in the first place :) If you have other image types you could find code to handle those and work that in. PHP''s getimagesize() method does most of them... and they all do it about the same way (read some bytes, do some math). -philip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, in addituion to what the others have posted, I would first check what plugins are available on the host. Good luck, -Conrad On 9/17/07, Tyler MacDonald <google.com-oTuY4Vk9bUDG8MNy1oJpyw@public.gmane.org> wrote:> > > I found some TCL code to do that here: > > http://wiki.tcl.tk/757 > > It shouldn''t be too hard to port that to ruby. :-) > > - Tyler > > > Taro <japtar10101-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi! I''m trying to make a site that can upload image files, but > > instead of posting each picture as their size, I''d rather post them in > > thumbnails (thank goodness html can warp images for you). I need to > > know how I can find a dimension of an image WITHOUT using a plugin > > (the server I am soon uploading this to most likely won''t have that > > plugin...and I don''t feel like forcing the administrators to download > > it). Are there any methods to take care of this? > > > > Thanks! > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---