Greetings all,
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:
http://beautifulpixel.textdriven.com/articles/2006/04/27/superimage-plugin-making-resizeable-uploaded-images-easy
svn: http://beautifulpixel.textdriven.com/svn/plugins/super_image/
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
def self.up
create_table :super_images, :force => true do |t|
t.column :data, :binary, :size => 10000000, :null => false
t.column :created_at, :datetime
end
execute “ALTER TABLE super_images
MODIFY data
MEDIUMBLOB”
end
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
SuperImagePlugin::Show”
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 < …
image_action :foo
end
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
appreciated.