提交 2dfcf659 编写于 作者: J John Bowler 提交者: Glenn Randers-Pehrson

[libpng16] Fixed NO_WRITE_FILTER and -Wconversion build breaks (John Bowler).

上级 b780eba4
......@@ -73,11 +73,13 @@ Version 1.6.18beta07 [June 3, 2015]
Removed non-working progressive reader 'skip' function. This
function has apparently never been used. It was implemented
to support back-door modification of png_struct in libpng-1.4.x
but was apparently never tested (because it does nothing and cannot
do anything).
but (because it does nothing and cannot do anything) was apparently
never tested (John Bowler).
Fixed cexcept.h in which GCC 5 now reports that one of the auto
variables in the Try macro needs to be volatile to prevent value
being lost over the setjmp.
being lost over the setjmp (John Bowler).
Fixed NO_WRITE_FILTER and -Wconversion build breaks (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
......
......@@ -5258,11 +5258,12 @@ Version 1.6.18beta07 [June 3, 2015]
Removed non-working progressive reader 'skip' function. This
function has apparently never been used. It was implemented
to support back-door modification of png_struct in libpng-1.4.x
but was apparently never tested (because it does nothing and cannot
do anything).
but (because it does nothing and cannot do anything) was apparently
never tested (John Bowler).
Fixed cexcept.h in which GCC 5 now reports that one of the auto
variables in the Try macro needs to be volatile to prevent value
being lost over the setjmp.
being lost over the setjmp (John Bowler).
Fixed NO_WRITE_FILTER and -Wconversion build breaks (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
......
......@@ -1032,6 +1032,7 @@ png_set_filter(png_structrp png_ptr, int method, int filters)
#endif /* WRITE_FILTER */
}
#ifdef PNG_WRITE_FILTER_SUPPORTED
/* If we have allocated the row_buf, this means we have already started
* with the image and we should have allocated all of the filter buffers
* that have been selected. If prev_row isn't already allocated, then
......@@ -1101,20 +1102,14 @@ png_set_filter(png_structrp png_ptr, int method, int filters)
}
}
png_ptr->do_filter = (png_byte)filters;
#endif
}
else
png_error(png_ptr, "Unknown custom filter method");
}
/* This allows us to influence the way in which libpng chooses the "best"
* filter for the current scanline. While the "minimum-sum-of-absolute-
* differences metric is relatively fast and effective, there is some
* question as to whether it can be improved upon by trying to keep the
* filtered data going to zlib more consistent, hopefully resulting in
* better compression.
*/
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* GRR 970116 */
/* Provide floating and fixed point APIs (DEPRECATED) */
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */
/* Provide floating and fixed point APIs */
#ifdef PNG_FLOATING_POINT_SUPPORTED
void PNGAPI
png_set_filter_heuristics(png_structrp png_ptr, int heuristic_method,
......
......@@ -1962,7 +1962,7 @@ png_write_start_row(png_structrp png_ptr)
int usr_pixel_depth;
#ifdef PNG_WRITE_FILTER_SUPPORTED
int filters;
png_byte filters;
#endif
png_debug(1, "in png_write_start_row");
......@@ -1983,10 +1983,10 @@ png_write_start_row(png_structrp png_ptr)
filters = png_ptr->do_filter;
if (png_ptr->height == 1)
filters &= ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH);
filters &= 0xff & ~(PNG_FILTER_UP|PNG_FILTER_AVG|PNG_FILTER_PAETH);
if (png_ptr->width == 1)
filters &= ~(PNG_FILTER_SUB|PNG_FILTER_AVG|PNG_FILTER_PAETH);
filters &= 0xff & ~(PNG_FILTER_SUB|PNG_FILTER_AVG|PNG_FILTER_PAETH);
if (filters == 0)
filters = PNG_FILTER_NONE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册