# Use file column magick only if file is an image?

**URL:** <https://www.ruby-forum.com/t/use-file-column-magick-only-if-file-is-an-image/89032>\
**Category:** Rails\
**Created:** [March 16, 2007, 5:23pm UTC](https://www.ruby-forum.com/t/use-file-column-magick-only-if-file-is-an-image/89032 "2007-03-16T17:23:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![friofool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@friofool](https://www.ruby-forum.com/u/friofool)\
**Post date:** [March 16, 2007, 5:23pm UTC](https://www.ruby-forum.com/t/use-file-column-magick-only-if-file-is-an-image/89032/1 "2007-03-16T17:23:39Z")

</div>

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
