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:
Diffstat (limited to 'source/blender/imbuf/intern/bmp.c')
-rw-r--r--source/blender/imbuf/intern/bmp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 8fa468949e7..df12f0b703e 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -38,6 +38,9 @@
#include "IMB_allocimbuf.h"
#include "IMB_filetype.h"
+#include "IMB_colormanagement.h"
+#include "IMB_colormanagement_intern.h"
+
/* some code copied from article on microsoft.com, copied
* here for enhanced BMP support in the future
* http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/mfcp1/mfcp1.htm&nav=/msj/0197/newnav.htm
@@ -115,7 +118,7 @@ int imb_is_a_bmp(unsigned char *buf)
return checkbmp(buf);
}
-struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
+struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
{
struct ImBuf *ibuf = NULL;
BMPINFOHEADER bmi;
@@ -127,6 +130,8 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
if (checkbmp(mem) == 0) return(NULL);
+ colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE);
+
if ((mem[0] == 'B') && (mem[1] == 'M')) {
/* skip fileheader */
mem += BMP_FILEHEADER_SIZE;
@@ -195,7 +200,6 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags)
if (ibuf) {
ibuf->ftype = BMP;
- ibuf->profile = IB_PROFILE_SRGB;
}
return(ibuf);