summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--img/load_pnm.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/img/load_pnm.lua b/img/load_pnm.lua
index 0c89662..86d2a67 100644
--- a/img/load_pnm.lua
+++ b/img/load_pnm.lua
@@ -78,8 +78,11 @@ 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)
+ 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