# Image versioning with FileColumn

**URL:** <https://www.ruby-forum.com/t/image-versioning-with-filecolumn/66592>\
**Category:** Rails\
**Created:** [August 27, 2006, 3:15pm UTC](https://www.ruby-forum.com/t/image-versioning-with-filecolumn/66592 "2006-08-27T15:15:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stewartm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewartm](https://www.ruby-forum.com/u/stewartm)\
**Post date:** [August 27, 2006, 3:15pm UTC](https://www.ruby-forum.com/t/image-versioning-with-filecolumn/66592/1 "2006-08-27T15:15:54Z")

</div>

hello,

I have recently discovered the file column plugin. so far I have got my  
images uploading and displaying just fine. However, I can’t seem to  
display two different versions of my image. I have a thumbnail and a  
medium size specified in my model.

class Image \< ActiveRecord::Base  
file\_column :image, :magick =\> {  
:versions =\> { “thumb” =\> “100x100”, “medium” =\> “640x480\>” }  
}  
end

from my list action I am calling to a thumbnail view.

\<%= image\_tag url\_for\_file\_column(image, “image”, “thumb” ), :alt =\>  
image.comment %\>

this seems to give me a nice thumbnail view however the dimensions of  
the image are set to 100 x 75. Here is the code that the above tag is  
outputting

![this is good](https://www.ruby-forum.com/image/image/11/thumb/10.jpg?1156677228)

in my show action I have the following code outputting the image

\<%= image\_tag url\_for\_file\_column(image, “image”, “medium” ), :alt =\>  
image.comment %\>

once again the image dimensions are set to 100 x 75. Where is rails  
getting this value from? And why does it not differentiate between the  
two versions of image I have specified?

thanks in advance for any help.

Stewart

---

<div class="post-metadata">

**Author:** ![stewartm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewartm](https://www.ruby-forum.com/u/stewartm)\
**Post date:** [August 27, 2006, 4:30pm UTC](https://www.ruby-forum.com/t/image-versioning-with-filecolumn/66592/2 "2006-08-27T16:30:40Z")

</div>

On 27 Aug 2006, at 14:15, Stewart M. wrote:

> file\_column :image, :magick =\> {  
> the image are set to 100 x 75. Here is the code that the above tag is  
> once again the image dimensions are set to 100 x 75. Where is rails  
> getting this value from? And why does it not differentiate between  
> the  
> two versions of image I have specified?
> 
> thanks in advance for any help.

I believe (correct me if I’m wrong) that the 100x100 is the maximum x/  
y values and the aspect ratio of the image uploaded is fixed to the  
uploaded image. So if you upload an image with a resolution of 200 x  
100, the file\_column plugin will resize it to 100 x 50. I would check  
your original image that you’re uploading.

Alastair

* * *

Alastair M.  
Standards compliant web development with Ruby On Rails, PHP and ASP  
[www.kozmo.co.uk](http://www.kozmo.co.uk)  
07738 399038

---

<div class="post-metadata">

**Author:** ![stewartm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@stewartm](https://www.ruby-forum.com/u/stewartm)\
**Post date:** [August 27, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/image-versioning-with-filecolumn/66592/3 "2006-08-27T16:42:54Z")

</div>

Alastair M. wrote:

> On 27 Aug 2006, at 14:15, Stewart M. wrote:
> 
> > file\_column :image, :magick =\> {  
> > the image are set to 100 x 75. Here is the code that the above tag is  
> > once again the image dimensions are set to 100 x 75. Where is rails  
> > getting this value from? And why does it not differentiate between  
> > the  
> > two versions of image I have specified?
> > 
> > thanks in advance for any help.
> 
> I believe (correct me if I’m wrong) that the 100x100 is the maximum x/  
> y values and the aspect ratio of the image uploaded is fixed to the  
> uploaded image. So if you upload an image with a resolution of 200 x  
> 100, the file\_column plugin will resize it to 100 x 50. I would check  
> your original image that you’re uploading.
> 
> Alastair
> 
> * * *
> 
> Alastair M.  
> Standards compliant web development with Ruby On Rails, PHP and ASP  
> [www.kozmo.co.uk](http://www.kozmo.co.uk)  
> 07738 399038

thanks so much Alastair,

thats exacley whats happening!
