views:

249

answers:

1

Hi,

I'd like to know how to convert png and gif files with alpha channel to jpg with white background with paperclip

I tried this but, it doesn't work
has_attached_file :photo, :whiny => false, :styles => { :medium => ["300x300>", :jpg], :thumb => ["100x100>", :jpg] }, :convert_options => { :all => '-alpha white -background white'}

It saves the file with the gray background thanks

+1  A: 

here the solution has_attached_file :photo, :styles => { :medium => ["300x300>", :jpg], :thumb => ["100x100>", :jpg] }, :convert_options => { :all => '-background white -flatten +matte'}

Mathieu