summaryrefslogtreecommitdiff
path: root/pngwrite.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-06-29 16:45:53 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2009-06-29 16:45:53 -0500
commit6878eb689955f7b82a1e38c75bc7b02debbd6b8f (patch)
treeb20611e3b2ab0024a2981e2a0616c0fdf1e2f104 /pngwrite.c
parentcd2634b3cedbb42defbeeaee98ec0df7c6d8f6be (diff)
downloadlibpng-6878eb689955f7b82a1e38c75bc7b02debbd6b8f.tar.gz
[devel] Relocate the INVERT_ALPHA function within png_read_png()
and png_write_png().
Diffstat (limited to 'pngwrite.c')
-rw-r--r--pngwrite.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/pngwrite.c b/pngwrite.c
index cc60d769b..27744a7b5 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -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 */