Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2014-08-13 14:39:36 +0400
committerDalai Felinto <dfelinto@gmail.com>2014-08-13 15:11:10 +0400
commit5b1f78e2d98efe8db5c111e6b97b8a13914810c0 (patch)
tree191254968aa491028869322581d289065d6ee0e4 /source/blender
parentbfaf4f2d0d4e600f6f8e253033de2b05a93e3ec1 (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.c5
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;
}
}