Forum: Ruby on Rails attachment_fu -- specify exact resize value

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.
1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 jko170 (Guest)
on 2007-04-18 02:50
(Received via mailing list)
How can you get the images and thumbnails to resize to an exact
demension? This is what I have in my model:

:resize_to => '150x150>',
:thumbnails => { :thumb => '31x31>' }

If the images are not perfectly squared, I get sizes like 31x23 or
112x150. I guess I would need the image to be cropped to become
exactly 31x31. Any suggestions?

Thanks in advance!
110c7df9fbc932cfe55c6317aedd04b3?d=identicon&s=25 jawgaping (Guest)
on 2007-04-18 02:58
(Received via mailing list)
You can remove the ">" at the end there or use an array [31, 31]
instead and it will squish the image to the size you want.

Cropping is not yet supported in the stable release of
attachment_fu... but if you are willing to do some editing in
attachment_fu .rb files here is a link so someone who claims they
found a solution:

Also here is something I found through a quick Google but I'm not sure
if it's any good either:

1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 jko170 (Guest)
on 2007-04-18 05:56
(Received via mailing list)
Perfect, thanks!
This topic is locked and can not be replied to.