Forum: Ruby on Rails file_column and adding/changing :versions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
34f5b045aec62235c17458650ea75353?d=identicon&s=25 Steve Koppelman (hatless)
on 2006-04-03 21:28
I'm using file_column 0.3.1 and I recently installed RMagick on my
machines, so I'm adding the :versions resizing functionality to my
models.

I quickly noticed that resized versions are only being created for newly
uploaded images, and that no magicked versions get created for existing
images. I thought file_column would be smart enough to generate
:versions as needed.

Has this been addressed in the trunk version? If so, I'll start grabbing
new versions of the plugin via SVN.

If not, is there a simple routine I can put in environment.rb or in a
rake task to force generation of :versions on existing images? I want to
be sure I can do one of these things painlessly before I go any further
because I don't want to have a big hassle if I choose to add more image
versions or change generated sizes as my app evolves.

Yes, I know this would be a very long, resource-intensive process if my
app had many thousands of images.. but it doesn't. However, there are
enough that requiring all images to be re-uploaded manually is not an
option.

If it's not already in place may I suggest having them generate
dynamically during url_for_file_column calls when the version of an
image doesn't already exist?

This really might be a better way to generate them in the first place,
rather than on upload as it seems to be.

Thanks.
This topic is locked and can not be replied to.