From 1a381ae76df1a19c711f58a74cdc0c750cbc5a43 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 12 Dec 2016 11:30:28 +1300 Subject: [PATCH] Fix handling of non-square DEM files The X and Y dimensions were swapped. Reported by detrito. --- src/gfxcore.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gfxcore.cc b/src/gfxcore.cc index 8708aef0..dd924e78 100644 --- a/src/gfxcore.cc +++ b/src/gfxcore.cc @@ -2518,8 +2518,8 @@ err += wxT("Unexpected value for " X); \ // I = little-endian; M = big-endian CHECK("BYTEORDER", (bigendian = (line[v] == 'M')) || line[v] == 'I') CHECK("LAYOUT", line.substr(v) == wxT("BIL")) - CHECK("NROWS", line.substr(v).ToCULong(&dem_width)) - CHECK("NCOLS", line.substr(v).ToCULong(&dem_height)) + CHECK("NROWS", line.substr(v).ToCULong(&dem_height)) + CHECK("NCOLS", line.substr(v).ToCULong(&dem_width)) CHECK("NBANDS", line.substr(v).ToCULong(&dummy) && dummy == 1) CHECK("NBITS", line.substr(v).ToCULong(&nbits) && nbits == 16) //: BANDROWBYTES 7202 -- 2.11.4.GIT