X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fglyphs-eimage.c;h=e3df95f92ffc2c863b7dce9d08fc7483ee62395a;hb=5d0cf827247def2db200614bf5d3ab700776d641;hp=c78627149995d8232ae2bc9db8c7c3d89e6f01d0;hpb=89559a53b9683058a6cea41ce3f8f6c9bd067238;p=chise%2Fxemacs-chise.git.1 diff --git a/src/glyphs-eimage.c b/src/glyphs-eimage.c index c786271..e3df95f 100644 --- a/src/glyphs-eimage.c +++ b/src/glyphs-eimage.c @@ -937,8 +937,8 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, { int y; unsigned char **row_pointers; - height = info_ptr->height; - width = info_ptr->width; + height = png_get_image_height (png_ptr, info_ptr) /* info_ptr->height */; + width = png_get_image_width (png_ptr, info_ptr) /* info_ptr->width */; /* Wow, allocate all the memory. Truly, exciting. */ unwind.eimage = xnew_array_and_zero (unsigned char, width * height * 3); @@ -990,22 +990,22 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, /* Now that we're using EImage, ask for 8bit RGB triples for any type of image*/ /* convert palette images to full RGB */ - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) + if (png_get_color_type(png_ptr, info_ptr) /* info_ptr->color_type */ == PNG_COLOR_TYPE_PALETTE) png_set_expand (png_ptr); /* send grayscale images to RGB too */ - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY || - info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + if (png_get_color_type(png_ptr, info_ptr) /* info_ptr->color_type */ == PNG_COLOR_TYPE_GRAY || + png_get_color_type(png_ptr, info_ptr) /* info_ptr->color_type */ == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb (png_ptr); /* we can't handle alpha values */ - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) + if (png_get_color_type(png_ptr, info_ptr) /* info_ptr->color_type */ & PNG_COLOR_MASK_ALPHA) png_set_strip_alpha (png_ptr); /* tell libpng to strip 16 bit depth files down to 8 bits */ - if (info_ptr->bit_depth == 16) + if (png_get_bit_depth(png_ptr, info_ptr) /* info_ptr->bit_depth */ == 16) png_set_strip_16 (png_ptr); /* if the image is < 8 bits, pad it out */ - if (info_ptr->bit_depth < 8) + if (png_get_bit_depth(png_ptr, info_ptr) /* info_ptr->bit_depth */ < 8) { - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) + if (png_get_color_type(png_ptr, info_ptr) /* info_ptr->color_type */ == PNG_COLOR_TYPE_GRAY) png_set_expand (png_ptr); else png_set_packing (png_ptr);