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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Eed3ca2591560a2dd91222d9b62f882d?d=identicon&s=25 Ryan Prins (Guest)
on 2007-01-03 08:01
(Received via mailing list)
Hi All,

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

Thanks in advance,

Ryan Prins
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2007-01-03 08:03
(Received via mailing list)
Look at:

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

View this message in context:
Sent from the RubyOnRails Users mailing list archive at
6329e9ce6b0c23f8bcf64a6c46a2bb81?d=identicon&s=25 matt (Guest)
on 2007-01-03 08:03
(Received via mailing list)
try FlexImage

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

Af31e731dc3f44620a7874d9602e5bc8?d=identicon&s=25 Evan (Guest)
on 2007-01-03 10:21
(Received via mailing list)
There are RoR plugins that allow you to resize and validate image
uploads.  Try the file_column plugin:
This topic is locked and can not be replied to.