FIX: only downsize user card & profile backgrounds
This commit is contained in:
parent
a24afe30d7
commit
fb62a7c0c3
|
@ -95,15 +95,16 @@ class Upload < ActiveRecord::Base
|
||||||
when "avatar"
|
when "avatar"
|
||||||
allow_animation = SiteSetting.allow_animated_avatars
|
allow_animation = SiteSetting.allow_animated_avatars
|
||||||
width = height = Discourse.avatar_sizes.max
|
width = height = Discourse.avatar_sizes.max
|
||||||
|
OptimizedImage.resize(file.path, file.path, width, height, filename: filename, allow_animation: allow_animation)
|
||||||
when "profile_background"
|
when "profile_background"
|
||||||
max_width = 850 * max_pixel_ratio
|
max_width = 850 * max_pixel_ratio
|
||||||
width, height = ImageSizer.resize(w, h, max_width: max_width, max_height: max_width)
|
width, height = ImageSizer.resize(w, h, max_width: max_width, max_height: max_width)
|
||||||
|
OptimizedImage.downsize(file.path, file.path, "#{width}x#{height}", filename: filename, allow_animation: allow_animation)
|
||||||
when "card_background"
|
when "card_background"
|
||||||
max_width = 590 * max_pixel_ratio
|
max_width = 590 * max_pixel_ratio
|
||||||
width, height = ImageSizer.resize(w, h, max_width: max_width, max_height: max_width)
|
width, height = ImageSizer.resize(w, h, max_width: max_width, max_height: max_width)
|
||||||
|
OptimizedImage.downsize(file.path, file.path, "#{width}x#{height}", filename: filename, allow_animation: allow_animation)
|
||||||
end
|
end
|
||||||
|
|
||||||
OptimizedImage.resize(file.path, file.path, width, height, filename: filename, allow_animation: allow_animation)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# optimize image
|
# optimize image
|
||||||
|
|
Loading…
Reference in New Issue