# File upload and check width and height of the picture

**URL:** <https://www.ruby-forum.com/t/file-upload-and-check-width-and-height-of-the-picture/58734>\
**Category:** Rails\
**Created:** [April 25, 2006, 12:32pm UTC](https://www.ruby-forum.com/t/file-upload-and-check-width-and-height-of-the-picture/58734 "2006-04-25T12:32:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@hanso](https://www.ruby-forum.com/u/hanso)\
**Post date:** [April 25, 2006, 12:32pm UTC](https://www.ruby-forum.com/t/file-upload-and-check-width-and-height-of-the-picture/58734/1 "2006-04-25T12:32:10Z")

</div>

i have an file upload in my rails app and i’m saving the picture in the  
filesystem.  
i need to validate if the uploaded picture have a certain width and  
height.

how can i do this

thank you very much

---

<div class="post-metadata">

**Author:** ![hanso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@hanso](https://www.ruby-forum.com/u/hanso)\
**Post date:** [April 25, 2006, 12:43pm UTC](https://www.ruby-forum.com/t/file-upload-and-check-width-and-height-of-the-picture/58734/2 "2006-04-25T12:43:30Z")

</div>

[RMajick](http://rmagick.rubyforge.org/) is the way to go

hannes stockner wrote:

> i have an file upload in my rails app and i’m saving the picture in the  
> filesystem.  
> i need to validate if the uploaded picture have a certain width and  
> height.
> 
> how can i do this
> 
> thank you very much

---

<div class="post-metadata">

**Author:** ![hanso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@hanso](https://www.ruby-forum.com/u/hanso)\
**Post date:** [April 25, 2006, 1:08pm UTC](https://www.ruby-forum.com/t/file-upload-and-check-width-and-height-of-the-picture/58734/3 "2006-04-25T13:08:06Z")

</div>

Yes - you won’t need to install the base applications either

hannes stockner wrote:

> it is also possible with tkimage?
> 
> Mick S. wrote:
> 
> > [RMajick](http://rmagick.rubyforge.org/) is the way to go
> > 
> > hannes stockner wrote:
> > 
> > > i have an file upload in my rails app and i’m saving the picture in the  
> > > filesystem.  
> > > i need to validate if the uploaded picture have a certain width and  
> > > height.
> > > 
> > > how can i do this
> > > 
> > > thank you very much

---

<div class="post-metadata">

**Author:** ![hanso](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@hanso](https://www.ruby-forum.com/u/hanso)\
**Post date:** [April 25, 2006, 1:02pm UTC](https://www.ruby-forum.com/t/file-upload-and-check-width-and-height-of-the-picture/58734/4 "2006-04-25T13:02:36Z")

</div>

it is also possible with tkimage?

Mick S. wrote:

> [RMajick](http://rmagick.rubyforge.org/) is the way to go
> 
> hannes stockner wrote:
> 
> > i have an file upload in my rails app and i’m saving the picture in the  
> > filesystem.  
> > i need to validate if the uploaded picture have a certain width and  
> > height.
> > 
> > how can i do this
> > 
> > thank you very much
