summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-02-03 13:59:12 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-02-03 13:59:12 +0100
commit4cd7e83a70f1c1b3ccb3dc63ee468cec593a71df (patch)
treeae3a51721c1dbf20d7e0162e94ac7eaa5d60cc08 /src
parentcca2ec58fbf2796347aa7ca4b5c1805b736face2 (diff)
downloadMinedMap-4cd7e83a70f1c1b3ccb3dc63ee468cec593a71df.tar
MinedMap-4cd7e83a70f1c1b3ccb3dc63ee468cec593a71df.zip
PNG: fix scaling of grayscale images
Diffstat (limited to 'src')
-rw-r--r--src/PNG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/PNG.cpp b/src/PNG.cpp
index 78df385..6f83fc5 100644
--- a/src/PNG.cpp
+++ b/src/PNG.cpp
@@ -130,7 +130,7 @@ static void readScaled(uint8_t *data, size_t offset_w, size_t offset_h, const ch
for (size_t h = 0; h < width/2; h++) {
for (size_t w = 0; w < width/2; w++) {
- for (size_t c = 0; c < 4; c++) {
+ for (size_t c = 0; c < b; c++) {
size_t i = 2*b*(width*h + w) + c;
data[b*(width*(offset_h+h) + offset_w+w) + c] = (input[i] + input[i+b] + input[i+b*width] + input[i+b*width+b])/4;
}