2015-01-29 12:36:35 -05:00
|
|
|
module Jobs
|
|
|
|
|
|
|
|
class ResizeEmoji < Jobs::Base
|
|
|
|
|
|
|
|
def execute(args)
|
|
|
|
path = args[:path]
|
|
|
|
return unless File.exists?(path)
|
|
|
|
|
2015-02-21 12:37:37 -05:00
|
|
|
opts = {
|
|
|
|
allow_animation: true,
|
|
|
|
force_aspect_ratio: SiteSetting.enforce_square_emoji
|
|
|
|
}
|
2015-01-29 12:36:35 -05:00
|
|
|
# make sure emoji aren't too big
|
2015-10-30 18:31:30 -04:00
|
|
|
OptimizedImage.downsize(path, path, "100x100", opts)
|
2015-01-29 12:36:35 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|