diff options
-rw-r--r-- | img/driver.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/img/driver.lua b/img/driver.lua index 8b12ac7..1a7c2f1 100644 --- a/img/driver.lua +++ b/img/driver.lua @@ -4,13 +4,18 @@ local load_pnm = require("load_pnm").load local better_disp = require("better_disp") local perr = require("util").perr +local function msgh(e) + local tb = debug.traceback() + return e .."\n"..tb +end + local file,err = io.open(arg[1],"rb") perr(err,"io.open") local ff = file:read("a") local img = load_pnm(ff) local W = window.create(term.current(),20,10,20,20) W.clear() -better_disp.disp(W,img,1,1) +xpcall(function() better_disp.disp(W,img,1,1) end,msgh) os.pullEvent("key") --shitty_disp.reset_palette(term.current()) |