diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2014-08-13 14:39:36 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2014-08-13 15:11:10 +0400 |
commit | 5b1f78e2d98efe8db5c111e6b97b8a13914810c0 (patch) | |
tree | 191254968aa491028869322581d289065d6ee0e4 /source/blender | |
parent | bfaf4f2d0d4e600f6f8e253033de2b05a93e3ec1 (diff) |
Image Editor: only do alpha test if output file requires alpha
(internal change, nothing should change to the user)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } } |