summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-05-16 16:50:42 -0600
committerTavian Barnes <tavianator@gmail.com>2011-05-16 16:50:42 -0600
commit719fea8f97320814835408fad6ce2a4647674c11 (patch)
tree6827ab83e6e0fa2ece31b4c927e40158b6fa8c38 /libdimension
parent83fc082320811b43d4660de00efaea7f40eb7102 (diff)
downloaddimension-719fea8f97320814835408fad6ce2a4647674c11.tar.xz
Fix typo in PNG reading.
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/png.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libdimension/png.c b/libdimension/png.c
index 534a085..d80ecc0 100644
--- a/libdimension/png.c
+++ b/libdimension/png.c
@@ -453,13 +453,13 @@ dmnsn_png_read_canvas_thread(void *ptr)
png_bytep png_pixel = image + 8*(y*width + x);
color.R = (double)((png_pixel[0] << 8) + png_pixel[1])/UINT16_MAX;
color.G = (double)((png_pixel[2] << 8) + png_pixel[3])/UINT16_MAX;
- color.R = (double)((png_pixel[4] << 8) + png_pixel[5])/UINT16_MAX;
+ color.B = (double)((png_pixel[4] << 8) + png_pixel[5])/UINT16_MAX;
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.R = (double)png_pixel[2]/UINT16_MAX;
+ color.B = (double)png_pixel[2]/UINT16_MAX;
color.trans = (double)png_pixel[3]/UINT16_MAX;
}
} else {
@@ -469,12 +469,12 @@ dmnsn_png_read_canvas_thread(void *ptr)
png_bytep png_pixel = image + 6*(y*width + x);
color.R = (double)((png_pixel[0] << 8) + png_pixel[1])/UINT16_MAX;
color.G = (double)((png_pixel[2] << 8) + png_pixel[3])/UINT16_MAX;
- color.R = (double)((png_pixel[4] << 8) + png_pixel[5])/UINT16_MAX;
+ 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.R = (double)png_pixel[2]/UINT16_MAX;
+ color.B = (double)png_pixel[2]/UINT16_MAX;
}
}