Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 356751
Collapse All | Expand All

(-)transfig.3.2.5d/fig2dev/dev/readpng.c (-7 / +9 lines)
Lines 62-68 read_png(file,filetype,pic,llx,lly) Link Here
62
    }
62
    }
63
63
64
    /* set long jump here */
64
    /* set long jump here */
65
    if (setjmp(png_ptr->jmpbuf)) {
65
    if (setjmp(png_jmpbuf(png_ptr))) {
66
	/* if we get here there was a problem reading the file */
66
	/* if we get here there was a problem reading the file */
67
	png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
67
	png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
68
	return 0;
68
	return 0;
Lines 78-92 read_png(file,filetype,pic,llx,lly) Link Here
78
    png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth, &color_type,
78
    png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth, &color_type,
79
	&interlace_type, &compression_type, &filter_type);
79
	&interlace_type, &compression_type, &filter_type);
80
80
81
    if (info_ptr->valid & PNG_INFO_gAMA)
81
    png_fixed_point gamma = 0.45;
82
	png_set_gamma(png_ptr, 2.2, info_ptr->gamma);
82
    png_get_gAMA_fixed(png_ptr,info_ptr,&gamma);
83
    else
83
    png_set_gamma(png_ptr, 2.2, gamma);
84
	png_set_gamma(png_ptr, 2.2, 0.45);
85
84
86
    if (info_ptr->valid & PNG_INFO_bKGD)
85
    if (png_get_valid(png_ptr,info_ptr,PNG_INFO_bKGD)) {
87
	/* set the background to the one supplied */
86
	/* set the background to the one supplied */
88
	png_set_background(png_ptr, &info_ptr->background,
87
    	png_color_16p background;
88
	png_get_bKGD(png_ptr,info_ptr,&background);
89
	png_set_background(png_ptr, background,
89
		PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
90
		PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
91
    }
90
    else {
92
    else {
91
	/* blend the canvas background using the alpha channel */
93
	/* blend the canvas background using the alpha channel */
92
	if (bgspec) {
94
	if (bgspec) {

Return to bug 356751