File_column and resizing only when it's bigger issue

I have limited space in my web design to display the logo of the
upcoming
event. So I put in code like this.

file_column :image, :magick => { :versions => { “250x165” =>
“250x165”}}

I was under the assumption that the image under directory 250x165 will
be of
this size if the image is bigger than 150x165. But I found out that for
an
image of size 134x88 the image under the directory is of 250x164.

So in this case the image had to be enlarged which doesn’t look good.
Since
in this case the original image itself was smaller than 150x165 , I had
rather use the original image.

I am using file_column plugin. Is there a way I can tell file_column to
keep
the original file under 250x165 if the the original image is smaller
than
250x165. Otherwise I will have to start storing the file size of the
original image and then compare and then sometimes use original image
and
sometime use the resized image.

Any suggestions on how to handle this case.

Thanks.

Raj S. wrote:

I have limited space in my web design to display the logo of the
upcoming
event. So I put in code like this.

file_column :image, :magick => { :versions => { “250x165” =>
“250x165”}}

I recommend using FlexImage:
http://www.agilewebdevelopment.com/plugins/fleximage

class MyImage
pre_process_image :size => ‘250x165’
end

Generally a little easier to handle that file_column in these
situations.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs