[devel] Relocate the INVERT_ALPHA function within png_read_png()

and png_write_png().
This commit is contained in:
Glenn Randers-Pehrson
2009-06-29 16:45:53 -05:00
parent cd2634b3ce
commit 6878eb6899
4 changed files with 16 additions and 12 deletions

View File

@@ -1347,11 +1347,6 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
{
if (png_ptr == NULL || info_ptr == NULL)
return;
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
/* Invert the alpha channel from opacity to transparency */
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
png_set_invert_alpha(png_ptr);
#endif
/* Write the file header information. */
png_write_info(png_ptr, info_ptr);
@@ -1411,6 +1406,12 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
png_set_packswap(png_ptr);
#endif
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
/* Invert the alpha channel from opacity to transparency */
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
png_set_invert_alpha(png_ptr);
#endif
/* ----------------------- end of transformations ------------------- */
/* Write the bits */