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/tiff.c')
-rw-r--r--source/blender/imbuf/intern/tiff.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 932a4941a0a..83830f260e1 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -114,7 +114,7 @@ static int imb_tiff_DummyMapProc(thandle_t fd, tdata_t *pbase, toff_t *psize)
* Reads data from an in-memory TIFF file.
*
* \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
- * \param data: Buffer to contain data (treat as void*).
+ * \param data: Buffer to contain data (treat as (void *)).
* \param n: Number of bytes to read.
*
* \return: Number of bytes actually read.
@@ -790,7 +790,14 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
/* convert from float source */
float rgb[4];
- linearrgb_to_srgb_v3_v3(rgb, &fromf[from_i]);
+ if (ibuf->float_colorspace) {
+ /* float buffer was managed already, no need in color space conversion */
+ copy_v3_v3(rgb, &fromf[from_i]);
+ }
+ else {
+ /* standard linear-to-srgb conversion if float buffer wasn't managed */
+ linearrgb_to_srgb_v3_v3(rgb, &fromf[from_i]);
+ }
rgb[3] = fromf[from_i + 3];