mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 08:32:26 +08:00
19 lines
363 B
Ruby
19 lines
363 B
Ruby
module Jobs
|
|
|
|
class ResizeEmoji < Jobs::Base
|
|
|
|
def execute(args)
|
|
path = args[:path]
|
|
return unless File.exists?(path)
|
|
|
|
opts = {
|
|
allow_animation: true,
|
|
force_aspect_ratio: SiteSetting.enforce_square_emoji
|
|
}
|
|
# make sure emoji aren't too big
|
|
OptimizedImage.downsize(path, path, 60, 60, opts)
|
|
end
|
|
end
|
|
|
|
end
|