summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdimension/png.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libdimension/png.c b/libdimension/png.c
index 82fa31a..7631804 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -362,10 +362,10 @@ dmnsn_png_read_canvas_thread(void *ptr)
color.trans = (double)((png_pixel[6] << 8) + png_pixel[7])/UINT16_MAX;
} else {
png_bytep png_pixel = image + 4*(y*width + x);
- color.R = (double)png_pixel[0]/UINT16_MAX;
- color.G = (double)png_pixel[1]/UINT16_MAX;
- color.B = (double)png_pixel[2]/UINT16_MAX;
- color.trans = (double)png_pixel[3]/UINT16_MAX;
+ color.R = (double)png_pixel[0]/UINT8_MAX;
+ color.G = (double)png_pixel[1]/UINT8_MAX;
+ color.B = (double)png_pixel[2]/UINT8_MAX;
+ color.trans = (double)png_pixel[3]/UINT8_MAX;
}
} else {
color.trans = 0.0;
@@ -377,9 +377,9 @@ dmnsn_png_read_canvas_thread(void *ptr)
color.B = (double)((png_pixel[4] << 8) + png_pixel[5])/UINT16_MAX;
} else {
png_bytep png_pixel = image + 3*(y*width + x);
- color.R = (double)png_pixel[0]/UINT16_MAX;
- color.G = (double)png_pixel[1]/UINT16_MAX;
- color.B = (double)png_pixel[2]/UINT16_MAX;
+ color.R = (double)png_pixel[0]/UINT8_MAX;
+ color.G = (double)png_pixel[1]/UINT8_MAX;
+ color.B = (double)png_pixel[2]/UINT8_MAX;
}
}