mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
makepng.c: correct the first row filter setting
It needs to include the "UP" filter so that libpng knows to retain the first line for the UP filter on the next one. Without this libpng ended up using NONE for the second line. Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
parent
8fae6609c0
commit
05399c8c82
@ -485,7 +485,10 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
|
||||
break;
|
||||
--size_max;
|
||||
}
|
||||
filters = (y == 0 ? PNG_FILTER_SUB : PNG_FILTER_UP);
|
||||
/* The first row must include PNG_FILTER_UP so that libpng knows we
|
||||
* need to keep it for the following row:
|
||||
*/
|
||||
filters = (y == 0 ? PNG_FILTER_SUB+PNG_FILTER_UP : PNG_FILTER_UP);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
@ -516,7 +519,7 @@ generate_row(png_bytep row, size_t rowbytes, unsigned int y, int color_type,
|
||||
0xFFU & (pixel_index + (byte_offset * 2*y) + 1);
|
||||
}
|
||||
}
|
||||
filters = (y == 0 ? PNG_FILTER_SUB : PNG_FILTER_UP);
|
||||
filters = (y == 0 ? PNG_FILTER_SUB+PNG_FILTER_UP : PNG_FILTER_UP);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user