Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 288725 Details for
Bug 385521
app-text/htmldoc-1.8.27-r2: failed to build with libpng-1.5.5
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
really quick hack to provide libpng-1.5 support
htmldoc-fix (text/plain), 3.18 KB, created by
Ian Stakenvicius (RETIRED)
on 2011-10-03 21:35:40 UTC
(
hide
)
Description:
really quick hack to provide libpng-1.5 support
Filename:
MIME Type:
Creator:
Ian Stakenvicius (RETIRED)
Created:
2011-10-03 21:35:40 UTC
Size:
3.18 KB
patch
obsolete
>--- htmldoc/image.cxx.old 2011-10-03 16:43:23.000000000 -0400 >+++ htmldoc/image.cxx 2011-10-03 16:59:05.000000000 -0400 >@@ -55,6 +55,7 @@ > #include <jpeglib.h> /* JPEG/JFIF image definitions */ > } > >+#include <zlib.h> > #include <png.h> /* Portable Network Graphics (PNG) definitions */ > > >@@ -1499,14 +1500,15 @@ > > rows = NULL; > >- if (setjmp(pp->jmpbuf)) >+ if (setjmp(png_jmpbuf(pp))) > { > progress_error(HD_ERROR_BAD_FORMAT, "PNG file contains errors!"); > > png_destroy_read_struct(&pp, &info, NULL); > >+/* -- no longer needed, afaik > if (img != NULL && img->pixels != NULL) >- free(img->pixels); >+ free(img->pixels); */ > > if (rows != NULL) > free(rows); >@@ -1526,7 +1528,7 @@ > > png_read_info(pp, info); > >- if (info->color_type & PNG_COLOR_MASK_PALETTE) >+ if (png_get_color_type(pp,info) & PNG_COLOR_MASK_PALETTE) > { > png_set_expand(pp); > >@@ -1535,29 +1537,29 @@ > if (Encryption) > img->use ++; > } >- else if (info->bit_depth < 8) >+ else if (png_get_bit_depth(pp,info) < 8) > { > png_set_packing(pp); > png_set_expand(pp); > } >- else if (info->bit_depth == 16) >+ else if (png_get_bit_depth(pp,info) == 16) > png_set_strip_16(pp); > >- if (info->color_type & PNG_COLOR_MASK_COLOR) >+ if (png_get_color_type(pp,info) & PNG_COLOR_MASK_COLOR) > { > depth = 3; >- img->depth = gray ? 1 : 3; >+ img->depth = gray ? 1 : 3; > } > else > { > depth = 1; >- img->depth = 1; >+ img->depth = 1; > } > >- img->width = info->width; >- img->height = info->height; >+ img->width = png_get_image_width(pp,info); >+ img->height = png_get_image_height(pp,info); > >- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans) >+ if ((png_get_color_type(pp,info) & PNG_COLOR_MASK_ALPHA)) > { > if ((PSLevel == 0 && PDFVersion >= 14) || PSLevel == 3) > image_need_mask(img, 8); >@@ -1572,6 +1574,7 @@ > #ifdef DEBUG > printf("color_type=0x%04x, depth=%d, img->width=%d, img->height=%d, img->depth=%d\n", > info->color_type, depth, img->width, img->height, img->depth); >+/* all of this is old and i don't care to bother converting > if (info->color_type & PNG_COLOR_MASK_COLOR) > puts(" COLOR"); > else >@@ -1580,6 +1583,7 @@ > puts(" ALPHA"); > if (info->color_type & PNG_COLOR_MASK_PALETTE) > puts(" PALETTE"); >+*/ > #endif // DEBUG > > if (!load_data) >@@ -1594,9 +1598,9 @@ > * Allocate pointers... > */ > >- rows = (png_bytep *)calloc(info->height, sizeof(png_bytep)); >+ rows = (png_bytep *)calloc(img->height, sizeof(png_bytep)); > >- for (i = 0; i < (int)info->height; i ++) >+ for (i = 0; i < (int)img->height; i ++) > rows[i] = img->pixels + i * img->width * depth; > > /* >@@ -1610,7 +1614,7 @@ > * Generate the alpha mask as necessary... > */ > >- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans) >+ if ((png_get_color_type(pp,info) & PNG_COLOR_MASK_ALPHA)) > { > #ifdef DEBUG > for (inptr = img->pixels, i = 0; i < img->height; i ++) >@@ -1639,7 +1643,7 @@ > * Reformat the data as necessary for the reader... > */ > >- if (gray && info->color_type & PNG_COLOR_MASK_COLOR) >+ if (gray && png_get_color_type(pp,info) & PNG_COLOR_MASK_COLOR) > { > /* > * Greyscale output needed...
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 385521
:
288721
| 288725