Commit: 5b1f78e2d98efe8db5c111e6b97b8a13914810c0
Author: Dalai Felinto
Date:   Wed Aug 13 12:39:36 2014 +0200
Branches: master
https://developer.blender.org/rB5b1f78e2d98efe8db5c111e6b97b8a13914810c0

Image Editor: only do alpha test if output file requires alpha

(internal change, nothing should change to the user)

===================================================================

M       source/blender/editors/space_image/image_ops.c

===================================================================

diff --git a/source/blender/editors/space_image/image_ops.c 
b/source/blender/editors/space_image/image_ops.c
index 66bd346..7344d40 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1485,9 +1485,10 @@ static bool save_image_doit(bContext *C, SpaceImage 
*sima, wmOperator *op, SaveI
                }
                else {
                        /* TODO, better solution, if a 24bit image is painted 
onto it may contain alpha */
-                       if (ibuf->userflags & IB_BITMAPDIRTY) { /* it has been 
painted onto */
+                       if ((simopts->im_format.planes == R_IMF_PLANES_RGBA) &&
+                           (ibuf->userflags & IB_BITMAPDIRTY)) { /* it has 
been painted onto */
                                /* checks each pixel, not ideal */
-                               ibuf->planes = BKE_imbuf_alpha_test(ibuf) ? 32 
: 24;
+                               ibuf->planes = BKE_imbuf_alpha_test(ibuf) ? 
R_IMF_PLANES_RGBA : R_IMF_PLANES_RGB;
                        }
                }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to