From f3ffdf9f287f40dc115071bc0e84576617923497 Mon Sep 17 00:00:00 2001 From: Garux Date: Sat, 30 Mar 2024 09:22:58 +0500 Subject: [PATCH] support 16bit png loading in radiant --- plugins/imagepng/plugin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/imagepng/plugin.cpp b/plugins/imagepng/plugin.cpp index 19eb8902..8c3a2d8c 100644 --- a/plugins/imagepng/plugin.cpp +++ b/plugins/imagepng/plugin.cpp @@ -107,6 +107,9 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){ if ( color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8 ) { png_set_expand_gray_1_2_4_to_8( png_ptr ); } + else if( bit_depth == 16 ){ + png_set_strip_16( png_ptr ); + } if ( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS ) ) { png_set_tRNS_to_alpha( png_ptr );