From 304f32fa988815c2780c709235724e94651d02ba Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Fri, 7 Nov 2014 10:14:05 -0600 Subject: Fix up old libminui to compile Implement some needed updates to libminui to make it compile for healthd. Note that res_create_multi_display_surface is not fully implemented so healthd may still have issues with displaying some graphics. Will update later when we are able to test these changes. Change-Id: Ic1095a998f5dfe7e36a08384c86da28e0524a03f --- minuitwrp/resources.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'minuitwrp') diff --git a/minuitwrp/resources.c b/minuitwrp/resources.c index c589c9d8a..3b833cc70 100644 --- a/minuitwrp/resources.c +++ b/minuitwrp/resources.c @@ -97,14 +97,16 @@ int res_create_surface_png(const char* name, gr_surface* pSurface) { png_set_sig_bytes(png_ptr, sizeof(header)); png_read_info(png_ptr, info_ptr); - size_t width = info_ptr->width; - size_t height = info_ptr->height; + int color_type, bit_depth; + size_t width, height; + + png_get_IHDR(png_ptr, info_ptr, width, height, &bit_depth, + &color_type, NULL, NULL, NULL); + + png_byte* channels = png_get_channels(png_ptr, info_ptr); size_t stride = 4 * width; size_t pixelSize = stride * height; - int color_type = info_ptr->color_type; - int bit_depth = info_ptr->bit_depth; - int channels = info_ptr->channels; if (!(bit_depth == 8 && ((channels == 3 && color_type == PNG_COLOR_TYPE_RGB) || (channels == 4 && color_type == PNG_COLOR_TYPE_RGBA) || -- cgit v1.2.3