mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Relocate the INVERT_ALPHA function within png_read_png()
and png_write_png().
This commit is contained in:
13
pngread.c
13
pngread.c
@@ -1195,12 +1195,6 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
|
||||
/* Invert the alpha channel from opacity to transparency
|
||||
*/
|
||||
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
|
||||
png_set_invert_alpha(png_ptr);
|
||||
#endif
|
||||
|
||||
/* png_read_info() gives us all of the information from the
|
||||
* PNG file before the first IDAT (image data chunk).
|
||||
@@ -1301,6 +1295,13 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
png_set_swap(png_ptr);
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
|
||||
/* Invert the alpha channel from opacity to transparency
|
||||
*/
|
||||
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
|
||||
png_set_invert_alpha(png_ptr);
|
||||
#endif
|
||||
|
||||
/* We don't handle adding filler bytes */
|
||||
|
||||
/* Optional call to gamma correct and add the background to the palette
|
||||
|
||||
Reference in New Issue
Block a user