[devel] Implement expansion to 16 bits

This commit is contained in:
John Bowler
2011-02-12 09:01:20 -06:00
committed by Glenn Randers-Pehrson
parent 9b872f4cf9
commit 4d56296443
8 changed files with 155 additions and 5 deletions

View File

@@ -3463,6 +3463,24 @@ png_read_start_row(png_structp png_ptr)
}
#endif
#ifdef PNG_READ_EXPAND_16_SUPPORTED
if (png_ptr->transformations & PNG_EXPAND_16)
{
# ifdef PNG_READ_EXPAND_SUPPORTED
/* In fact it is an error if it isn't supported, but checking is
* the safe way.
*/
if (png_ptr->transformations & PNG_EXPAND)
{
if (png_ptr->bit_depth < 16)
max_pixel_depth *= 2;
}
else
# endif
png_ptr->transformations &= ~PNG_EXPAND_16;
}
#endif
#ifdef PNG_READ_FILLER_SUPPORTED
if (png_ptr->transformations & (PNG_FILLER))
{