# Attachment\_fu, minimum width and height, how?

**URL:** <https://www.ruby-forum.com/t/attachment-fu-minimum-width-and-height-how/145279>\
**Category:** Rails\
**Created:** [August 7, 2008, 2:03pm UTC](https://www.ruby-forum.com/t/attachment-fu-minimum-width-and-height-how/145279 "2008-08-07T14:03:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xdmx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/53a042/32.png) [@xdmx](https://www.ruby-forum.com/u/xdmx)\
**Post date:** [August 7, 2008, 2:03pm UTC](https://www.ruby-forum.com/t/attachment-fu-minimum-width-and-height-how/145279/1 "2008-08-07T14:03:03Z")

</div>

Hi guys, i’m using attachment\_fu for uploading images, but i’ve to check  
that the width and the height are at least 200px, how can i do this?  
I’ve tried to do a validate

errors.add(:width, ‘’) if self.parent\_id.nil? and self.width \< 200

But this doesn’t work, both the width and height are nil, so i think  
that them are set after the validation.  
Any idea?

Thanks
