This is the first release of the SuperImage plugin. The idea is you
upload images to the database, and then pull them out at any size you
want. Combine this with caching and it will stay light and fast.
More info and instructions are here:
That’s all well and good and useable, but there are 2 things I would
like to improve. I am stuck on them, however.
First, the included migration is an ugly hack
create_table :super_images, :force => true do |t|
t.column :data, :binary, :size => 10000000, :null => false
t.column :created_at, :datetime
execute “ALTER TABLE
I just could not get the ruby definition for :data to create a
MEDIUMBLOB on mysql. The size parameter seems to have been completely
disregarded. The clomun sets up as BLOB with a size limit of 16K, which
is far to small for most image uploading needs.
Second, the “show_image” action is currently included in via “include
This works, but it means the action name that performs the image
retrieval is locked in to be “show_image”. I would like to have it
works this way:
class MyImagesController < …
Then you can access the images via “/my_images/foo/12”. Sadly though,
metaprogramming like this still makes my head spin.
If anyone has ideas about alleviating these 2 points, it sure would be