add combine image logic (#14)
* add combine image logic * remove unnecessary log
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
--local str = "form-data; name=\"files[]\"; filename=\"Song-of-joy.png\""
|
||||
--local ext = ngx.re.match(str, [[filename=".*\.(\w+)"]], "jo")
|
||||
--print(ext)
|
||||
|
||||
local magick = "/usr/local/ImageMagick/bin/magick"
|
||||
local tmp = io.open(magick,"r")
|
||||
if tmp == nil then
|
||||
-- in mac os
|
||||
magick = "/usr/local/bin/magick"
|
||||
else
|
||||
io.close(tmp)
|
||||
end
|
||||
print(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)
|
||||
|
||||
@@ -1,8 +1,2 @@
|
||||
---
|
||||
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
||||
--- Created by moicen.
|
||||
--- DateTime: 2021/9/4 12:20
|
||||
---
|
||||
|
||||
ngx.say('file dir...', ngx.var.tmp_file_dir)
|
||||
ngx.say('task server...', ngx.var.task_server)
|
||||
Reference in New Issue
Block a user