Use file column magick only if file is an image?

Hello,

I have a model like this :

class Biblio::BibliothequeContent < ActiveRecord::Base

has_many :bibliotheque_content_types

has_many :bibliotheque_dossier_contents

file_column :nom_fichier,:store_dir => “public/files/”,:magick => {
:versions => { “thumb” => “50x50”,“mini” => “200x200”, “medium” =>
“640x480>” }}

end

I just want to use he :magick option only if the uploaded file is in jpg
or gif format.

Maybe a solution with a specific validation ?

Thx