Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 262181 Details for
Bug 354551
dev-python/matplotlib-1.0.1: fix libpng deprecations for libpng15
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
a working patch
matplotlib-1.0.1-libpng15.patch (text/plain), 2.34 KB, created by
Rafał Mużyło
on 2011-02-12 00:39:19 UTC
(
hide
)
Description:
a working patch
Filename:
MIME Type:
Creator:
Rafał Mużyło
Created:
2011-02-12 00:39:19 UTC
Size:
2.34 KB
patch
obsolete
>--- src/_png.cpp.old 2010-10-12 18:14:42.000000000 +0200 >+++ src/_png.cpp 2011-02-12 01:33:14.000000000 +0100 >@@ -350,10 +350,10 @@ > png_set_sig_bytes(png_ptr, 8); > png_read_info(png_ptr, info_ptr); > >- png_uint_32 width = info_ptr->width; >- png_uint_32 height = info_ptr->height; >+ png_uint_32 width, height; >+ int bit_depth, color_type; > >- int bit_depth = info_ptr->bit_depth; >+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, NULL, NULL, NULL); > > // Unpack 1, 2, and 4-bit images > if (bit_depth < 8) >@@ -361,7 +361,7 @@ > > // If sig bits are set, shift data > png_color_8p sig_bit; >- if ((info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) && >+ if ((color_type != PNG_COLOR_TYPE_PALETTE) && > png_get_sBIT(png_ptr, info_ptr, &sig_bit)) > { > png_set_shift(png_ptr, sig_bit); >@@ -374,19 +374,20 @@ > } > > // Convert palletes to full RGB >- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) >+ if (color_type == PNG_COLOR_TYPE_PALETTE) > { > png_set_palette_to_rgb(png_ptr); > } > > // If there's an alpha channel convert gray to RGB >- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) >+ if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) > { > png_set_gray_to_rgb(png_ptr); > } > > png_set_interlace_handling(png_ptr); > png_read_update_info(png_ptr, info_ptr); >+ color_type = png_get_color_type(png_ptr, info_ptr); > > /* read file */ > if (setjmp(png_jmpbuf(png_ptr))) >@@ -408,11 +409,11 @@ > npy_intp dimensions[3]; > dimensions[0] = height; //numrows > dimensions[1] = width; //numcols >- if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) >+ if (color_type & PNG_COLOR_MASK_ALPHA) > { > dimensions[2] = 4; //RGBA images > } >- else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) >+ else if (color_type & PNG_COLOR_MASK_COLOR) > { > dimensions[2] = 3; //RGB images > } >@@ -421,7 +422,7 @@ > dimensions[2] = 1; //Greyscale images > } > //For gray, return an x by y array, not an x by y by 1 >- int num_dims = (info_ptr->color_type & PNG_COLOR_MASK_COLOR) ? 3 : 2; >+ int num_dims = (color_type & PNG_COLOR_MASK_COLOR) ? 3 : 2; > > double max_value = (1 << ((bit_depth < 8) ? 8 : bit_depth)) - 1; > PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNew(
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 354551
:
262179
| 262181