mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 10:08:20 -05:00
18 lines
365 B
Ruby
18 lines
365 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, 100, 100, opts)
|
|
end
|
|
end
|
|
|
|
end
|