Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 286743 Details for
Bug 383211
x11-misc/xaos fails to build with libpng-1.5
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
fix for libpng-1.5
xaos-fix.patch (text/plain), 4.95 KB, created by
Ian Stakenvicius (RETIRED)
on 2011-09-17 03:22:30 UTC
(
hide
)
Description:
fix for libpng-1.5
Filename:
MIME Type:
Creator:
Ian Stakenvicius (RETIRED)
Created:
2011-09-17 03:22:30 UTC
Size:
4.95 KB
patch
obsolete
>--- src/util/png.c.old 2011-09-16 22:43:23.000000000 -0400 >+++ src/util/png.c 2011-09-16 23:12:45.000000000 -0400 >@@ -2,6 +2,7 @@ > #ifndef _plan9_ > #include <aconfig.h> > #ifdef USE_PNG >+#include <zlib.h> > #include <png.h> > #endif > #include <stdlib.h> >@@ -31,6 +32,7 @@ > png_structp png_ptr; > png_infop info_ptr; > png_color palette[256]; >+ png_color_8 sig_bit; > volatile unsigned short a = 255; > volatile unsigned char *b = (volatile unsigned char *) &a; > #ifdef _undefined_ >@@ -59,66 +61,73 @@ > png_destroy_write_struct(&png_ptr, (png_infopp) NULL); > return "No memory to create png info structure"; > } >- if (setjmp(png_ptr->jmpbuf)) { >+ if (setjmp(png_jmpbuf(png_ptr))) { > png_destroy_write_struct(&png_ptr, &info_ptr); > fclose(file); > return strerror(errno); > } > png_init_io(png_ptr, file); >- png_set_filter(png_ptr, 0, >- PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_PAETH | >- PNG_FILTER_UP | PNG_FILTER_AVG); >- /* set the zlib compression level */ >- /*png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); */ >- png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION); >- >- /* set other zlib parameters */ >- png_set_compression_mem_level(png_ptr, 8); >- png_set_compression_strategy(png_ptr, Z_DEFAULT_STRATEGY); >- png_set_compression_window_bits(png_ptr, 15); >- png_set_compression_method(png_ptr, 8); >- >- info_ptr->width = image->width; >- info_ptr->height = image->height; >- /*info_ptr->gamma=1.0; */ >- info_ptr->gamma = 0.5; >- info_ptr->valid |= PNG_INFO_gAMA | PNG_INFO_pHYs; >- info_ptr->x_pixels_per_unit = (png_uint_32) (100 / image->pixelwidth); >- info_ptr->y_pixels_per_unit = (png_uint_32) (100 / image->pixelheight); > >+ int _bit_depth,_color_type,_interlace_type; > > switch (image->palette->type) { > case C256: > { > int i; >- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; >- info_ptr->bit_depth = image->bytesperpixel * 8; >- info_ptr->palette = palette; >- info_ptr->valid |= PNG_INFO_PLTE; >- for (i = 0; i < image->palette->end; i++) >- info_ptr->palette[i].red = image->palette->rgb[i][0], >- info_ptr->palette[i].green = image->palette->rgb[i][1], >- info_ptr->palette[i].blue = image->palette->rgb[i][2], >- info_ptr->num_palette = image->palette->end; >+ _color_type = PNG_COLOR_TYPE_PALETTE; >+ _bit_depth = image->bytesperpixel * 8; >+ for (i = 0; i < image->palette->end; i++) { >+ palette[i].red = image->palette->rgb[i][0]; >+ palette[i].green = image->palette->rgb[i][1]; >+ palette[i].blue = image->palette->rgb[i][2]; >+ } >+ png_set_PLTE(png_ptr,info_ptr,&palette,image->palette->end); > } > break; > case SMALLITER: > case LARGEITER: > case GRAYSCALE: >- info_ptr->color_type = PNG_COLOR_TYPE_GRAY; >- info_ptr->bit_depth = image->bytesperpixel * 8; >+ _color_type = PNG_COLOR_TYPE_GRAY; >+ _bit_depth = image->bytesperpixel * 8; > break; > case TRUECOLOR: > case TRUECOLOR24: > case TRUECOLOR16: >- info_ptr->color_type = PNG_COLOR_TYPE_RGB; >- info_ptr->bit_depth = 8; >- info_ptr->sig_bit.red = 8 - image->palette->info.truec.rprec; >- info_ptr->sig_bit.green = 8 - image->palette->info.truec.gprec; >- info_ptr->sig_bit.blue = 8 - image->palette->info.truec.bprec; >+ _color_type = PNG_COLOR_TYPE_RGB; >+ _bit_depth = 8; >+ sig_bit.red = 8 - image->palette->info.truec.rprec; >+ sig_bit.green = 8 - image->palette->info.truec.gprec; >+ sig_bit.blue = 8 - image->palette->info.truec.bprec; >+ png_set_sBIT(png_ptr,info_ptr,&sig_bit); > break; > } >- info_ptr->interlace_type = 0; >+ _interlace_type = 0; >+ >+ png_set_IHDR(png_ptr,info_ptr,image->width,image->height, >+ _bit_depth,_color_type,_interlace_type, >+ PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT); >+ >+ /*info_ptr->gamma=1.0; */ >+ /* technically should look up screen gamma for this, defaulting to 1.0 */ >+ png_set_gamma(png_ptr,1.0,0.5); >+ png_set_pHYs(png_ptr,info_ptr, >+ (png_uint_32) (100 / image->pixelwidth), >+ (png_uint_32) (100 / image->pixelheight), >+ PNG_RESOLUTION_UNKNOWN); >+ >+ png_set_filter(png_ptr, 0, >+ PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_PAETH | >+ PNG_FILTER_UP | PNG_FILTER_AVG); >+ /* set the zlib compression level */ >+ /*png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); */ >+ png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION); >+ >+ /* set other zlib parameters */ >+ png_set_compression_mem_level(png_ptr, 8); >+ png_set_compression_strategy(png_ptr, Z_DEFAULT_STRATEGY); >+ png_set_compression_window_bits(png_ptr, 15); >+ png_set_compression_method(png_ptr, 8); >+ > #ifdef _undefined_ > png_set_text(png_ptr, info_ptr, comments, > sizeof(comments) / sizeof(png_text)); >@@ -128,7 +137,7 @@ > /*png_set_filler(png_ptr,0,PNG_FILLER_AFTER); */ > png_set_packing(png_ptr); > if (image->palette->type & (TRUECOLOR | TRUECOLOR24 | TRUECOLOR16)) >- png_set_shift(png_ptr, &(info_ptr->sig_bit)); >+ png_set_shift(png_ptr, &sig_bit); > if (*b == 255) > png_set_swap(png_ptr); > png_set_bgr(png_ptr);
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 Raw
Actions:
View
Attachments on
bug 383211
:
286653
| 286743