add logic to handle image magick in linux

This commit is contained in:
moicen
2021-09-12 11:29:30 +08:00
parent a0fdd62319
commit a02cfd090d
+4
View File
@@ -15,11 +15,15 @@ for i = 1, len do
end end
-- 从 nginx 变量取 -- 从 nginx 变量取
local magick = ngx.var.magick local magick = ngx.var.magick
local convert = ngx.var.convert
if not magick then if not magick then
if not convert then
ngx.status = 500 ngx.status = 500
ngx.say("image magick not found.") ngx.say("image magick not found.")
return return
end
magick = ""
end end
local result, _, code = os.execute(magick .. " convert -append " .. table.concat(origin, " ") .. " " .. combined) local result, _, code = os.execute(magick .. " convert -append " .. table.concat(origin, " ") .. " " .. combined)