a0fdd62319
* use nginx variable to get magick * remove comments
29 lines
751 B
Lua
29 lines
751 B
Lua
-- read from nginx var config
|
|
local magick = ngx.var.magick
|
|
ngx.log(ngx.ERR, 'var', magick)
|
|
-- or use which command to get
|
|
if not magick then
|
|
local exec = io.popen("which magick")
|
|
local tmp = exec:read("*a")
|
|
magick = string.gsub(tmp, "%s+", "")
|
|
exec:close()
|
|
end
|
|
if not magick then
|
|
ngx.status = 500
|
|
ngx.say("image magick not found.")
|
|
return
|
|
end
|
|
|
|
ngx.say(magick)
|
|
|
|
|
|
--local origin = {
|
|
-- "/Users/moicen/Music/alchemy/Song-of-joy.png",
|
|
-- "/Users/moicen/Music/alchemy/You-and-me.png"
|
|
--}
|
|
--origin = table.concat(origin, " ")
|
|
--ngx.log(ngx.ERR, origin)
|
|
--local file = io.popen("/usr/local/bin/magick convert -append " .. origin .. " /tmp/combined.jpeg" )
|
|
--local output = file:read("*all")
|
|
--file:close()
|
|
--ngx.say(output) |