diff options
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_image.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c index 396df4ff402..5f444357776 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c @@ -65,9 +65,28 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i if(ibuf==NULL) return NULL; - if(ibuf->rect_float==NULL) - IMB_float_from_rect(ibuf); + if (rd->color_mgt_flag & R_COLOR_MANAGEMENT) { + if (ibuf->profile == IB_PROFILE_NONE) { + if (ibuf->rect_float != NULL) { + imb_freerectfloatImBuf(ibuf); + } + ibuf->profile = IB_PROFILE_SRGB; + IMB_float_from_rect(ibuf); + } + } else { + if (ibuf->profile == IB_PROFILE_SRGB) { + if (ibuf->rect_float != NULL) { + imb_freerectfloatImBuf(ibuf); + } + ibuf->profile = IB_PROFILE_NONE; + IMB_float_from_rect(ibuf); + } + } + if (ibuf->rect_float == NULL) { + IMB_float_from_rect(ibuf); + } + type= ibuf->channels; if(rd->scemode & R_COMP_CROP) { |