diff options
author | ubq323 <ubq323@ubq323.website> | 2022-08-06 23:15:57 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-08-06 23:15:57 +0100 |
commit | 2dc2e1494c931ccf4e79687ffa2b0b472c63fbc1 (patch) | |
tree | 78cb20e573defcde1387c3f8a53672cda33867a1 | |
parent | 0974b8841550a12bd1996171031b6bde911fa5d2 (diff) |
img
-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()) |