mirror of
https://github.com/discourse/discourse.git
synced 2025-03-07 19:59:33 +00:00
Generate avatars with transparent background
Generate avatars with transparent background (for .png images) or with white background (for others).
This commit is contained in:
parent
7cfb583016
commit
6b0e8e2ec1
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user