remove magick variable, use convert for all platform

This commit is contained in:
moicen
2021-12-30 00:46:59 +08:00
committed by 阿男
parent 327586a667
commit 4fa3dd0760
+8 -12
View File
@@ -1,5 +1,5 @@
local uuid = require "resty.jit-uuid"
local cjson = require "cjson"
local uuid = require "resty.jit-uuid"
local cjson = require "cjson"
uuid.seed()
local file_dir = ngx.var.tmp_file_dir
@@ -12,7 +12,7 @@ local len = table.getn(data)
if len == 0 then
ngx.status = 500
ngx.log(ngx.ERR, "No images to combine!")
return;
return ;
end
local origin = {}
for i = 1, len do
@@ -20,19 +20,15 @@ for i = 1, len do
origin[i] = file_dir .. "/" .. data[i] .. " "
end
-- 从 nginx 变量取
local magick = ngx.var.magick
local convert = ngx.var.convert
if not magick then
if not convert then
ngx.status = 500
ngx.log(ngx.ERR, "ImageMagick NOT FOUND.")
return
end
magick = ""
if not convert then
ngx.status = 500
ngx.log(ngx.ERR, "ImageMagick NOT FOUND.")
return
end
local cmd = magick .. " " .. convert .. " -append " .. table.concat(origin, " ") .. " " .. combined
local cmd = convert .. " -append " .. table.concat(origin, " ") .. " " .. combined
ngx.log(ngx.INFO, 'CMD -> ', cmd)
local result, _, code = os.execute(cmd)
if result and code == 0 then