On 22 nov, 08:55, "Cyril Mougel" <
cyril.mou...@gmail.com> wrote:
>
http://groups.google.com/group/railsfrance/browse_thread/thread/0cb1ea5d44bcb056?hl=fr
> This makes it easy to convert an image file to another format. Simply
> write the image file using a name that has either a prefix or a suffix
> corresponding to the format you want.
>
> Je ne sais que te dire. Je n'ai pas encore testé.
>
> [1] :
http://www.imagemagick.org/RMagick/doc/imusage.html
>
> --
> Cyril Mougelhttp://
blog.shingara.fr
J'ai bien lu la documentataion ( du moins je pense),pour etre plus
precis voila les codes que j'ai testé dans mon modele sans succes et
les extraits de doc qui les justifie
file_column :logo ,:magick => { :size =>"80x110>",
:attributes=>{:format =>"PNG"}}
(doc de file_column)
:To change some of the image properties like compression level before
they are saved you can set the :attributes option. For a list of
available attributes go to
www.simplesystems.org/RMagick/doc/info.html
et quand on click sur le lien on constate bien que "format " et dans
la liste
j'ai donc voulu voir un peu plus loint j'ai donc exploré un peu le
plugin et dans magick_file_column.rb
j'ai rajouté dans transform_image
if img_options[:ombre_porte]
img.format="PNG"
img.background_color = "none"
shadow=img.shadow(x_offset=3, y_offset=0, sigma=1.5,
opacity=img_options[:ombre_porte])
img=shadow.composite(img, Magick::NorthWestGravity,
Magick::OverCompositeOp)
end
mon modele deviens
file_column :logo ,:magick => { :size =>"80x110>",
:ombre_porte => 0,7}
aucune des deux solutions ne fonctionne j'obtient bien une image avec
une ombre mais toute noire car le format reste jpg (si j'upload un
jpg) et fonctonne biensure avec un png
j'espere avoir ete un peu plus precis qu'hier soir