# File\_column image versions

**URL:** <https://www.ruby-forum.com/t/file-column-image-versions/62635>\
**Category:** Rails\
**Created:** [June 6, 2006, 9:02pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635 "2006-06-06T21:02:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 6, 2006, 9:02pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/1 "2006-06-06T21:02:23Z")

</div>

does anyone know much about resizing different versions of images with  
file\_column? i tried it and everything works fine, but my question is  
can you do more than just make sizes with a version of image? i’m  
working on a photo album and i would like to resize the image to a  
medium size, but create a thumbnail as well and crop anything left to  
make the thumbnail a perfect square.

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 6, 2006, 10:13pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/2 "2006-06-06T22:13:20Z")

</div>

Josh K. wrote:

> does anyone know much about resizing different versions of images with  
> file\_column? i tried it and everything works fine, but my question is  
> can you do more than just make sizes with a version of image? i’m  
> working on a photo album and i would like to resize the image to a  
> medium size, but create a thumbnail as well and crop anything left to  
> make the thumbnail a perfect square.

Try SuperImage instead. It supports dynamic resizing of images at  
runtime, and includes options to crop to a specific size.

[http://mydomain.com/images/123?size=125x125&crop=true](http://mydomain.com/images/123?size=125x125&crop=true)

I believe file\_column only creates the image version when you first  
upload the image, but SuperImage allows you to dynamically generate what  
you need.

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 6, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/3 "2006-06-06T22:15:40Z")

</div>

Alex W. wrote:

> Josh K. wrote:
> 
> > does anyone know much about resizing different versions of images with  
> > file\_column? i tried it and everything works fine, but my question is  
> > can you do more than just make sizes with a version of image? i’m  
> > working on a photo album and i would like to resize the image to a  
> > medium size, but create a thumbnail as well and crop anything left to  
> > make the thumbnail a perfect square.
> 
> Try SuperImage instead. It supports dynamic resizing of images at  
> runtime, and includes options to crop to a specific size.
> 
> [http://mydomain.com/images/123?size=125x125&crop=true](http://mydomain.com/images/123?size=125x125&crop=true)
> 
> I believe file\_column only creates the image version when you first  
> upload the image, but SuperImage allows you to dynamically generate what  
> you need.

Oops, forgot link:  
[http://beautifulpixel.com/super\_image/index.html](http://beautifulpixel.com/super_image/index.html)

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 6, 2006, 10:24pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/4 "2006-06-06T22:24:49Z")

</div>

Josh K. wrote:

> Alex W. wrote:
> 
> > Alex W. wrote:
> > 
> > > Josh K. wrote:
> > > 
> > > > does anyone know much about resizing different versions of images with  
> > > > file\_column? i tried it and everything works fine, but my question is  
> > > > can you do more than just make sizes with a version of image? i’m  
> > > > working on a photo album and i would like to resize the image to a  
> > > > medium size, but create a thumbnail as well and crop anything left to  
> > > > make the thumbnail a perfect square.
> > > 
> > > Try SuperImage instead. It supports dynamic resizing of images at  
> > > runtime, and includes options to crop to a specific size.
> > > 
> > > [http://mydomain.com/images/123?size=125x125&crop=true](http://mydomain.com/images/123?size=125x125&crop=true)
> > > 
> > > I believe file\_column only creates the image version when you first  
> > > upload the image, but SuperImage allows you to dynamically generate what  
> > > you need.
> > 
> > Oops, forgot link:  
> > [http://beautifulpixel.com/super\_image/index.html](http://beautifulpixel.com/super_image/index.html)
> 
> how is this on speed? i’m working on a site that has high traffic loads  
> so i think i would rather have the images already generated beforehand.

As long as you use cacheing there will be no difference. The initial  
generation of each image will be a small hit, but page\_cacheing makes it  
snappy after that.

class MyControllerNameController \< ApplicationController  
include SuperImagePlugin::Show  
image\_action :show\_my\_image  
caches\_page :show\_my\_image  
end

would do the trick.

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 6, 2006, 10:20pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/5 "2006-06-06T22:20:12Z")

</div>

Alex W. wrote:

> Alex W. wrote:
> 
> > Josh K. wrote:
> > 
> > > does anyone know much about resizing different versions of images with  
> > > file\_column? i tried it and everything works fine, but my question is  
> > > can you do more than just make sizes with a version of image? i’m  
> > > working on a photo album and i would like to resize the image to a  
> > > medium size, but create a thumbnail as well and crop anything left to  
> > > make the thumbnail a perfect square.
> > 
> > Try SuperImage instead. It supports dynamic resizing of images at  
> > runtime, and includes options to crop to a specific size.
> > 
> > [http://mydomain.com/images/123?size=125x125&crop=true](http://mydomain.com/images/123?size=125x125&crop=true)
> > 
> > I believe file\_column only creates the image version when you first  
> > upload the image, but SuperImage allows you to dynamically generate what  
> > you need.
> 
> Oops, forgot link:  
> [http://beautifulpixel.com/super\_image/index.html](http://beautifulpixel.com/super_image/index.html)

how is this on speed? i’m working on a site that has high traffic loads  
so i think i would rather have the images already generated beforehand.

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 7, 2006, 5:59pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/6 "2006-06-07T17:59:11Z")

</div>

Is Sebastian still maintaining file\_column?

Do you see any potential to merge your versions or take over  
development?

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 7, 2006, 6:05pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/7 "2006-06-07T18:05:29Z")

</div>

i actually got what i wanted. i accomplished it with this in my model:

class Photo \< ActiveRecord::Base  
file\_column :image,  
:magick =\> { :versions =\> { :thumb =\> { :crop =\> ‘1:1’,  
:geometry =\> ‘50x50’ },  
:medium =\> { :geometry =\>  
‘400x400\>’ }  
}  
}  
end

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 7, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/file-column-image-versions/62635/8 "2006-06-07T17:34:03Z")

</div>

On 6/6/06, Josh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> does anyone know much about resizing different versions of images with  
> file\_column? i tried it and everything works fine, but my question is  
> can you do more than just make sizes with a version of image? i’m  
> working on a photo album and i would like to resize the image to a  
> medium size, but create a thumbnail as well and crop anything left to  
> make the thumbnail a perfect square.

[http://svn.kylemaxwell.com/file\_column](http://svn.kylemaxwell.com/file_column) (my file\_column branch).  
There’s no “versions”. Instead, you can specify one initial, optional  
transformation, using the ImageMagick command-line syntax:

file\_column :image\_field, :magick =\> “-resize 1000x”

And you can specify an arbitrary number of view transformations using:

\<%=url\_for\_file\_column “model”, “image\_field”, :magick =\> "-rotate 90

- resize 40x10!" %\>

–  
Kyle M.  
Chief Technologist  
E Factor Media // FN Interactive  
removed\_email\_address@domain.invalid  
1-866-263-3261
