From 5b1f78e2d98efe8db5c111e6b97b8a13914810c0 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 13 Aug 2014 12:39:36 +0200 Subject: Image Editor: only do alpha test if output file requires alpha (internal change, nothing should change to the user) --- source/blender/editors/space_image/image_ops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 66bd346ae69..7344d4012ed 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; } } -- cgit v1.2.3