From 6b0e8e2ec163b7fcefc588e9cebc76ec9ac7cde5 Mon Sep 17 00:00:00 2001 From: Anton Batenev Date: Wed, 14 Aug 2013 19:13:43 +0400 Subject: [PATCH] Generate avatars with transparent background Generate avatars with transparent background (for .png images) or with white background (for others). --- lib/jobs/generate_avatars.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jobs/generate_avatars.rb b/lib/jobs/generate_avatars.rb index 9be32b3cb..9a22220ee 100644 --- a/lib/jobs/generate_avatars.rb +++ b/lib/jobs/generate_avatars.rb @@ -22,7 +22,7 @@ module Jobs temp_file = Tempfile.new(["discourse-avatar", File.extname(original_path)]) temp_path = temp_file.path # - Discourse.store.store_avatar(temp_file, upload, size) if ImageSorcery.new(original_path).convert(temp_path, gravity: "center", thumbnail: "#{size}x#{size}^", extent: "#{size}x#{size}") + Discourse.store.store_avatar(temp_file, upload, size) if ImageSorcery.new(original_path).convert(temp_path, gravity: "center", thumbnail: "#{size}x#{size}^", extent: "#{size}x#{size}", background: "transparent") # close && remove temp file temp_file.close! end