From 2a14a8ba3d97562919f585383db0dc800636fe5a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 5 Aug 2022 16:52:56 +0100 Subject: fix whitespaceness --- img/load_pnm.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'img/load_pnm.lua') diff --git a/img/load_pnm.lua b/img/load_pnm.lua index 1fd4b70..af866ee 100644 --- a/img/load_pnm.lua +++ b/img/load_pnm.lua @@ -79,14 +79,14 @@ local function parse(imgf) local has_depth = not(typech == 1 or typech == 4) - local width,height,cur = imgf:match("%s*(%d+)%s*(%d+)%s*()",3) + local width,height,cur = imgf:match("\x0a(%d+) (%d+)\x0a()",3) width,height = tonumber(width),tonumber(height) assert(width,"couldn't find image dimensions") -- by 'depth' i mean 'maximum value' local depth = 1 if has_depth then - local ndepth,ncur = imgf:match("(%d+)%s*()",cur) + local ndepth,ncur = imgf:match("(%d+)\x0a()",cur) ndepth=tonumber(ndepth) assert(ndepth,"couldn't find image depth (max pixel value), in a format that needs it") depth=ndepth -- cgit v1.2.3