summaryrefslogtreecommitdiff
path: root/img/load_pnm.lua
diff options
context:
space:
mode:
Diffstat (limited to 'img/load_pnm.lua')
-rw-r--r--img/load_pnm.lua4
1 files changed, 2 insertions, 2 deletions
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