Skip to content
jlsync edited this page Apr 4, 2012 · 3 revisions

Fleximage can record certain image metadata to your database for you. This works exactly the same as Rails magic fields like created_at. Simply having a field with the right name in your database table will let Fleximage know that those fields need to be populated when an image is uploaded.

image_filename, :string

The field will autofill with the filename of the uploaded file. It will not include the local path, just the name of the file itself. If the image was uploaded via URL, the entire URL is saved.

image_width, :integer

Records the width, in pixels, of the uploaded image.

image_height, :integer

Records the height, in pixels, of the uploaded image.

image_format, :string

Records the image format – useful for when no default image_storage_format is set

Adding migration code for my own convenience (Torey)

t.column :image_filename, :string
t.column :image_width, :integer
t.column :image_height, :integer
t.column :image_format, :string