From 2dc2e1494c931ccf4e79687ffa2b0b472c63fbc1 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 6 Aug 2022 23:15:57 +0100 Subject: img --- img/driver.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'img') 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()) -- cgit v1.2.3