separate image combine logic
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
|
||||
|
||||
-- https://stackoverflow.com/questions/4990990/check-if-a-file-exists-with-lua
|
||||
local function file_exists(name)
|
||||
local f = io.open(name,"r")
|
||||
if f~=nil then io.close(f) return true else return false end
|
||||
end
|
||||
|
||||
|
||||
local file_to_check = string.match(ngx.var.request_uri, ".*/(.*)")
|
||||
local file_dir = ngx.var.tmp_file_dir
|
||||
|
||||
local fullpath = file_dir .. "/" .. file_to_check .. ".jpeg";
|
||||
|
||||
ngx.say(file_exists(fullpath))
|
||||
|
||||
Reference in New Issue
Block a user