seenu
2009-Apr-03 10:15 UTC
How to find out image width and height which is saved in database?
How to find out image width and height which is saved in database, with out using any applications or addons Please help --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn
2009-Apr-03 12:54 UTC
Re: How to find out image width and height which is saved in database?
On Apr 3, 2009, at 6:15 AM, seenu wrote:> > How to find out image width and height which is saved in database, > with out using any applications or addons Please helpYou could do what I did: http://gist.github.com/89738 Then you can do things like: irb> require ''image_size'' => true irb> x=ImageSize.of_file(''/Users/rab/Pictures/Boston_MIT_8L4L2442.jpg'') => #<ImageSize:0x32df98 @height=678, @image=#<File:/Users/rab/Pictures/ Boston_MIT_8L4L2442.jpg (closed)>, @width=1024, @jpeg_dimension_segment="\377\300\000\021\b \002\246\004\000\003\001\"\000\002\021\001\003\021\001", @header="\377\330\377\340\000\020JFIF\000\001\001\001\000`\000` \000\000\377\333\000C\000\006\004\005\006\005\004\006\006\005\006\a\a \006\b\n\020\n\n\t\t\n\024\016\017\f \020\027\024\030\030\027\024\026\026\032\035%\037\032\e#\034\026\026 , #&'')*)\031\037-0-(0%()(\377\333\000C\001\a\a\a\n\b\n\023\n\n \023 (\032 \026 \032 ((((((((((((((((((((((((((((((((((((((((((((((((((\377\300\000\021\b \002\246\004\000\003\001\"\000\002\021\001\003\021\001\377\304", @image_type=:jpeg> irb> x.width => 1024 irb> x.height => 678 irb> x.dimensions => [1024, 678] irb> x.size => "1024x678" irb> x.content_type => "image/jpeg" Well, unless you consider that an addon, of course. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---