This commit is contained in:
2023-01-16 22:53:20 +08:00
parent 6159d6440f
commit bdae2e9163
3 changed files with 4 additions and 8 deletions
-1
View File
@@ -41,7 +41,6 @@ server {
return 200;
}
location /api/ngx/image/check {
content_by_lua_file $resty_loc/nginx/scripts/check_file.lua;
}
+4 -4
View File
@@ -21,12 +21,12 @@ local file_dir = ngx.var.tmp_file_dir
ngx.req.read_body()
local req_body = cjson.decode(ngx.req.get_body_data())
ngx.log(ngx.INFO, 'REQ_BODY -> ', ngx.req.get_body_data())
local data = req_body["payload"]["images"]
local images = req_body["payload"]["images"]
local combined_uuid = uuid.generate_v4()
local combined = file_dir .. "/" .. combined_uuid .. ".png";
local len = table.getn(data)
local len = table.getn(images)
if len == 0 then
ngx.status = 500
ngx.log(ngx.ERR, "No images to combine!")
@@ -45,8 +45,8 @@ if not convert then
end
for i = 1, len do
ngx.log(ngx.INFO, "COMBINE FILE -> ", data[i])
incoming = file_dir .. "/" .. data[i]
ngx.log(ngx.INFO, "COMBINE FILE -> ", images[i])
incoming = file_dir .. "/" .. images[i]
origin[i] = incoming .. ".png "
local cmd = convert .. " -resize 1280x " .. incoming .. " " .. origin[i]
ngx.log(ngx.INFO, 'CMD RESIZE -> ', cmd)
-3
View File
@@ -19,9 +19,6 @@ local function create_task(httpc, task_text, authHeader, sudoerToken)
ngx.log(ngx.INFO, 'remote_url -> ', remote_url)
ngx.log(ngx.INFO, 'Authorization -> ', authHeader)
ngx.log(ngx.INFO, 'HtySudoerToken -> ', sudoerToken)
ngx.log(ngx.INFO, 'UPLOAD_PICTURE *body_text* ->', task_text)
local res, err = httpc:request_uri(
remote_url,