# "Attachment\_fu" not resizing the images properly

**URL:** <https://www.ruby-forum.com/t/attachment-fu-not-resizing-the-images-properly/179136>\
**Category:** Rails\
**Created:** [November 18, 2009, 9:04am UTC](https://www.ruby-forum.com/t/attachment-fu-not-resizing-the-images-properly/179136 "2009-11-18T09:04:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gandhi-tush](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Post date:** [November 18, 2009, 9:04am UTC](https://www.ruby-forum.com/t/attachment-fu-not-resizing-the-images-properly/179136/1 "2009-11-18T09:04:15Z")

</div>

Hi,  
I am using “attachment\_fu” plugin for file upload.  
I am able to upload photos also.  
I have a problem that I have given the resize size to “400 X 400”.  
But whenever I am uploading the photo it is resizing the image to “400 X  
300”.  
Sane thing is happening for the thumbnail as well. I am giving thumbnail  
size to “100 X 100” but it is creating image of “100 X 75”  
I am not able to get why it is happening.  
Any one have any idea.

Here is my model code==  
"  
class Filedata \< ActiveRecord::Base  
has\_attachment :content\_type =\> :image,  
:storage =\> :file\_system,  
:max\_size =\> 500.kilobytes,  
:resize\_to =\> ‘400x400\>’,  
:thumbnails =\> { :thumb =\> ‘100x100\>’ },  
:path\_prefix =\>‘public/user’

end  
"

Also, I have to change the path\_prefix to folder which is outside the  
project directory.

Any help appreciated.  
Thanks,  
Tushar

---

<div class="post-metadata">

**Author:** ![gandhi-tush](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Post date:** [November 18, 2009, 7:21pm UTC](https://www.ruby-forum.com/t/attachment-fu-not-resizing-the-images-properly/179136/2 "2009-11-18T19:21:04Z")

</div>

I am not an expert in this, but may be it is keeping the ratio? (make it  
“400x400” not “400x400\>”)

---

<div class="post-metadata">

**Author:** ![gandhi-tush](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Post date:** [November 19, 2009, 4:48am UTC](https://www.ruby-forum.com/t/attachment-fu-not-resizing-the-images-properly/179136/3 "2009-11-19T04:48:00Z")

</div>

Did you Read The Fine Manual?

If your original image is not square (and the behaviors you are  
describing tells me that it is not), then the 400x400\> and 100x100\>  
specs are what you want to use… otherwise you’re skewing the aspect  
ratio and the image will likely look horrible or amaturely done.
