discourse/app/jobs/regular/resize_emoji.rb

19 lines
366 B
Ruby
Raw Normal View History

module Jobs
class ResizeEmoji < Jobs::Base
def execute(args)
path = args[:path]
return unless File.exists?(path)
2015-02-22 01:37:37 +08:00
opts = {
allow_animation: true,
force_aspect_ratio: SiteSetting.enforce_square_emoji
}
# make sure emoji aren't too big
2016-04-01 05:33:25 +08:00
OptimizedImage.downsize(path, path, "100x100", opts)
end
end
end