The file column plug-in is great, but there is a problem with it. Well,
two… But the other is well documented now. :^)
Consider a time when you’ve created a CMS for a client and it’s been in
use for over a year. Say 1500+ images have been uploaded so far. Now the
client comes back with a simple request… ‘Can you change the thumbnail
size to 80/90, rather than 70/70? It shouldn’t take you more than half a
‘No problem!’ you say, ‘I’ll just change the CSS here, and the article
model here and… Oh.’ Broken images all over the place. No images at
all if you use Firefox.
It wasn’t quite 1500 images, but I ended up writing a script to
systematically go through each image in the database and resize it to
order… File column helpfully handles removing the old sizes for you.
This is all a but un-rails-like though. I’d expect the plugin to
automatically realise that the resized image is missing and create it on
the fly. It has all the tools and data to do so, and the perfomance hit
will only be felt once, by the first user who encounters the image. I’d
take that to be an acceptable compromise.
I have, in fact, written such code quite successfully in PHP. However,
I’m new to Ruby and not completely comfortable with it yet. Has anyone
done it themselves? If not, has anyone looked into the File Column code
enough to give me a few pointers? Obviously if I get it working I’ll
release it back to the Rails community…
Or does anyone think I’ve gone mad and should stick to scripts? ;^)