From ce9ee99c076847490902ce2777dadf86aa1a2970 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 26 May 2012 17:04:51 +0000 Subject: [PATCH] Fix #31538: Wrong colors after reloading file with exr image Issue was caused by generated images had got no profile set (IB_PROFILE_NONE) which confused OpenEXR saver (which makes sRGB conversion for profiles which are not linear). Actually this is much deeper issue which would require the whole color pipeline workflow (which would happen at some point when currently urgent stuff is resolved), but having correct profile set for generated images would still be helpful. --- source/blender/blenkernel/intern/image.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 797a2093729..80b192c7a42 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -592,10 +592,12 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char if (floatbuf) { ibuf = IMB_allocImBuf(width, height, depth, IB_rectfloat); rect_float = (float *)ibuf->rect_float; + ibuf->profile = IB_PROFILE_LINEAR_RGB; } else { ibuf = IMB_allocImBuf(width, height, depth, IB_rect); rect = (unsigned char *)ibuf->rect; + ibuf->profile = IB_PROFILE_SRGB; } BLI_strncpy(ibuf->name, name, sizeof(ibuf->name));