use nginx variable to get magick (#20)
* use nginx variable to get magick * remove comments
This commit is contained in:
@@ -13,14 +13,13 @@ local origin = {}
|
||||
for i = 1, len do
|
||||
origin[i] = file_dir .. "/" .. data[i] .. " "
|
||||
end
|
||||
-- linux
|
||||
local magick = "/usr/local/ImageMagick/bin/magick"
|
||||
local tmp = io.open(magick,"r")
|
||||
if tmp == nil then
|
||||
-- mac os
|
||||
magick = "/usr/local/bin/magick"
|
||||
else
|
||||
io.close(tmp)
|
||||
-- 从 nginx 变量取
|
||||
local magick = ngx.var.magick
|
||||
|
||||
if not magick then
|
||||
ngx.status = 500
|
||||
ngx.say("image magick not found.")
|
||||
return
|
||||
end
|
||||
|
||||
local result, _, code = os.execute(magick .. " convert -append " .. table.concat(origin, " ") .. " " .. combined)
|
||||
|
||||
Reference in New Issue
Block a user