source: trunk/dports/editors/xemacs/files/bcefd94fa6513d48f4dc8519f633b2df66b553bc.diff @ 142901

Last change on this file since 142901 was 142901, checked in by dstrubbe@…, 5 years ago

xemacs: Return to the stable branch 21.4, by popular demand. The newer 21.5 beta branch has been causing problems.

File size: 3.2 KB
  • src/glyphs-eimage.c

    # HG changeset patch
    # User Vin Shelton <acs@xemacs.org>
    # Date 1342078132 14400
    # Node ID bcefd94fa6513d48f4dc8519f633b2df66b553bc
    # Parent  2cf343fcb482fa6644675f3174c3c0712c53c074
    Support libpng-1.5.10
    
    diff -r 2cf343fcb482fa6644675f3174c3c0712c53c074 -r bcefd94fa6513d48f4dc8519f633b2df66b553bc src/glyphs-eimage.c
    a b  
    937937  {
    938938    int y, padding;
    939939    unsigned char **row_pointers;
    940     height = info_ptr->height;
    941     width = info_ptr->width;
     940    height = png_get_image_height(png_ptr, info_ptr);
     941    width = png_get_image_width(png_ptr, info_ptr);
    942942
    943943    /* Wow, allocate all the memory.  Truly, exciting.
    944944       Well, yes, there's excitement to be had.  It turns out that libpng
     
    999999    /* Now that we're using EImage, ask for 8bit RGB triples for any type
    10001000       of image*/
    10011001    /* convert palette images to full RGB */
    1002     if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
     1002    if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE)
    10031003      png_set_expand (png_ptr);
    10041004    /* send grayscale images to RGB too */
    1005     if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
    1006         info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
     1005    if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
     1006       png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
    10071007      png_set_gray_to_rgb (png_ptr);
    10081008    /* tell libpng to strip 16 bit depth files down to 8 bits */
    1009     if (info_ptr->bit_depth == 16)
     1009    if (png_get_bit_depth(png_ptr, info_ptr) == 16)
    10101010      png_set_strip_16 (png_ptr);
    10111011    /* if the image is < 8 bits, pad it out */
    1012     if (info_ptr->bit_depth < 8)
     1012    if (png_get_bit_depth(png_ptr, info_ptr) < 8)
    10131013      {
    1014         if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
     1014       if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY)
    10151015          png_set_expand (png_ptr);
    10161016        else
    10171017          png_set_packing (png_ptr);
     
    10211021       png_read_update_info ensures the alpha flag is set when one of
    10221022       the transforms above causes an alpha channel to be generated */
    10231023    png_read_update_info (png_ptr, info_ptr);
    1024     if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
     1024    if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
    10251025      png_set_strip_alpha (png_ptr);
    10261026
    10271027    png_read_image (png_ptr, row_pointers);
     
    10361036     * from lisp anyway. - WMP
    10371037     */
    10381038    {
    1039       int i;
     1039      int i, num_text = 0;
     1040      png_textp text_ptr = NULL;
    10401041
    1041       for (i = 0 ; i < info_ptr->num_text ; i++)
     1042      if (png_get_text (png_ptr, info_ptr, &text_ptr, &num_text) > 0)
    10421043        {
    1043           /* How paranoid do I have to be about no trailing NULLs, and
    1044              using (int)info_ptr->text[i].text_length, and strncpy and a temp
    1045              string somewhere? */
     1044          for (i = 0 ; i < num_text ; i++)
     1045            {
    10461046
    1047           warn_when_safe (Qpng, Qinfo, "%s - %s",
    1048                           info_ptr->text[i].key,
    1049                           info_ptr->text[i].text);
     1047              /* How paranoid do I have to be about no trailing NULLs, and
     1048                 using (int)info_ptr->text[i].text_length, and strncpy and a temp
     1049                 string somewhere? */
     1050
     1051              warn_when_safe (Qpng, Qinfo, "%s - %s",
     1052                              text_ptr[i].key, text_ptr[i].text);
     1053            }
     1054
    10501055        }
    10511056    }
    10521057#endif
Note: See TracBrowser for help on using the repository browser.