diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-05-16 16:50:42 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-05-16 16:50:42 -0600 |
commit | 719fea8f97320814835408fad6ce2a4647674c11 (patch) | |
tree | 6827ab83e6e0fa2ece31b4c927e40158b6fa8c38 | |
parent | 83fc082320811b43d4660de00efaea7f40eb7102 (diff) | |
download | dimension-719fea8f97320814835408fad6ce2a4647674c11.tar.xz |
Fix typo in PNG reading.
-rw-r--r-- | libdimension/png.c | 8 |
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; } } |