diff --git a/components/rtgui/common/image_png.c b/components/rtgui/common/image_png.c index 3560f7a2ffc8f1d0954693b6e67882b00f06befe..ff17bf275122a52b7d6dcffe715fe4133b421c2f 100644 --- a/components/rtgui/common/image_png.c +++ b/components/rtgui/common/image_png.c @@ -54,6 +54,19 @@ static rt_bool_t rtgui_image_png_process(png_structp png_ptr, png_infop info_ptr switch (info_ptr->color_type) { + case PNG_COLOR_TYPE_RGB: + for (y = 0; y < info_ptr->height; y++) + { + png_read_row(png_ptr, row, png_bytep_NULL); + for (x = 0; x < info_ptr->width; x++) + { + data = &(row[x * 3]); + + ptr[x+y*info_ptr->width] = RTGUI_RGB(data[0], data[1], data[2]); + } + } + break; + case PNG_COLOR_TYPE_RGBA: for (y = 0; y < info_ptr->height; y++) {