diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-23 17:19:51 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-23 17:19:51 -0300 |
commit | 08e536dbe0ed12f7f1548c38f1cc19ccde19ea94 (patch) | |
tree | 917feaf9dfb8738070398fd533dfe366afbe86fc /drivers/png | |
parent | de7fe2fced036154993376e245c694a03ef70172 (diff) |
-Support the TRNS flag on libpng, fixes #3097
Diffstat (limited to 'drivers/png')
-rw-r--r-- | drivers/png/image_loader_png.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index a86e747d80..50b26d601a 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -124,6 +124,13 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image) png_read_update_info(png, info); } + if (png_get_valid(png,info,PNG_INFO_tRNS)) { +// png_set_expand_gray_1_2_4_to_8(png); + png_set_tRNS_to_alpha(png); + png_read_update_info(png, info); + png_get_IHDR(png, info, &width, &height, &depth, &color, NULL, NULL, NULL); + } + int palette_colors = 0; int palette_components = 0; int components = 0; |