DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2449
Version: 1.3-current
RGB PNG images are displayed as RGBA.
The commit (r7832) updated Fl_PNG_Image to the latest libpng. However, the
channel counting results in an extra (non-existent) channel to be seen by
Fl_PNG_Image.
I have attached a trivial patch that appears to correct the issue. The
patch removes num_trans. AFAICT, num_trans is not used anywhere else in
Fl_PNG_Image. Therefore, it may be redundant anyhow?
Link: http://www.fltk.org/str.php?L2449
Version: 1.3-current
Index: src/Fl_PNG_Image.cxx
===================================================================
--- src/Fl_PNG_Image.cxx (revision 7868)
+++ src/Fl_PNG_Image.cxx (working copy)
@@ -98,9 +98,7 @@
else
channels = 1;
- int num_trans;
- png_get_tRNS(pp, info, 0, &num_trans, 0);
- if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || (num_trans !=
0))
+ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA)
channels ++;
w((int)(png_get_image_width(pp, info)));
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs