Forum: Ruby on Rails Get Image Dimensions Given Local File Path

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ryan P. (Guest)
on 2007-01-03 09:01
(Received via mailing list)
Hi All,

I have an image file (.jpg) that I can open via File.open() and I am
curious
on the easiest way to get the dimensions of this file.  I'd prefer this
to
be a ruby/rails way and not a javascript method.  Basically, I am
looking
for a way to verify that when a user uploads an image file that it is
not
larger than x by y.  I've been looking around the web and I'm having
trouble
finding a way to do this.  Also, if there is a way to just resize any
image
over some pre-defined size that would work as well.

Thanks in advance,
Ryan

--
Ryan P.
removed_email_address@domain.invalid
http://www.lazyi.net
Steve R. (Guest)
on 2007-01-03 09:03
(Received via mailing list)
Look at:

http://www.simplesystems.org/RMagick/doc/comtasks.html


Ryan P. wrote:
> finding a way to do this.  Also, if there is a way to just resize any
>
> >
>
>

--
View this message in context:
http://www.nabble.com/-Rails--Get-Image-Dimensions...
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
matt (Guest)
on 2007-01-03 09:03
(Received via mailing list)
try FlexImage  http://beautifulpixel.com/flex_image/index.html

It allows you to crop, resize, etc.  checkout the RDoc link above, and
see if that will work for you.

Matt
Evan (Guest)
on 2007-01-03 11:21
(Received via mailing list)
There are RoR plugins that allow you to resize and validate image
uploads.  Try the file_column plugin:

http://www.kanthak.net/opensource/file_column/
This topic is locked and can not be replied to.