diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2014-11-07 17:14:05 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2014-11-07 17:14:08 +0100 |
commit | 304f32fa988815c2780c709235724e94651d02ba (patch) | |
tree | faad7be2d26400cb7ed0fa70ee3d09bd345c0ed9 /minuitwrp | |
parent | Revert "Make libminuitwrp compile" (diff) | |
download | android_bootable_recovery-304f32fa988815c2780c709235724e94651d02ba.tar android_bootable_recovery-304f32fa988815c2780c709235724e94651d02ba.tar.gz android_bootable_recovery-304f32fa988815c2780c709235724e94651d02ba.tar.bz2 android_bootable_recovery-304f32fa988815c2780c709235724e94651d02ba.tar.lz android_bootable_recovery-304f32fa988815c2780c709235724e94651d02ba.tar.xz android_bootable_recovery-304f32fa988815c2780c709235724e94651d02ba.tar.zst android_bootable_recovery-304f32fa988815c2780c709235724e94651d02ba.zip |
Diffstat (limited to 'minuitwrp')
-rw-r--r-- | minuitwrp/resources.c | 12 |
1 files changed, 7 insertions, 5 deletions
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) || |