mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Implement expansion to 16 bits
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
9b872f4cf9
commit
4d56296443
18
pngrutil.c
18
pngrutil.c
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user