add combine wx type images
This commit is contained in:
+14
-2
@@ -21,8 +21,11 @@ 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 image_origin = read_body["payload"]["image_origin"]
|
||||
local images = req_body["payload"]["images"]
|
||||
|
||||
ngx.log(ngx.INFO, "IMAGE ORIGIN -> ", image_origin)
|
||||
|
||||
local combined_uuid = uuid.generate_v4()
|
||||
local output_filename = combined_uuid .. ".jpeg";
|
||||
local output_filepath = file_dir .. "/" .. output_filename
|
||||
@@ -46,8 +49,17 @@ if not convert then
|
||||
end
|
||||
|
||||
for i = 1, len do
|
||||
ngx.log(ngx.INFO, "COMBINE FILE -> ", images[i])
|
||||
local incoming = file_dir .. "/" .. images[i]
|
||||
|
||||
local incoming
|
||||
|
||||
if image_origin == "WX" then
|
||||
ngx.log(ngx.INFO, "DOWNLOAD WX FILE -> ", images[i])
|
||||
incoming = get_wx_media(httpc, images[i], cjson, pl);
|
||||
else
|
||||
ngx.log(ngx.INFO, "COMBINE FILE -> ", images[i])
|
||||
incoming = file_dir .. "/" .. images[i]
|
||||
end
|
||||
|
||||
origin[i] = incoming .. ".png "
|
||||
local cmd = convert .. " -resize 642x1389 -strip -quality 75% " .. incoming .. " " .. origin[i]
|
||||
ngx.log(ngx.INFO, 'CMD RESIZE -> ', cmd)
|
||||
|
||||
Reference in New Issue
Block a user