[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50857] trunk/blender/source/blender/imbuf /intern/colormanagement.c: Some further fixes for #32626: TIFF renders are limited to 8 bit even when we choose 16.

Sergey Sharybin sergey.vfx at gmail.com
Mon Sep 24 20:22:33 CEST 2012


Revision: 50857
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50857
Author:   nazgul
Date:     2012-09-24 18:22:33 +0000 (Mon, 24 Sep 2012)
Log Message:
-----------
Some further fixes for #32626: TIFF renders are limited to 8 bit even when we choose 16.

File type was checking for wrong flags, now it should be checked against
actual file format flags which would be used on save.

We also can not free float buffer if file format doesn't have IM_FTYPE_FLOAT
flag -- i.e. TIFF doesn't have such flag and it decides whether float or
byte buffer should be used based on image depth.

Modified Paths:
--------------
    trunk/blender/source/blender/imbuf/intern/colormanagement.c

Modified: trunk/blender/source/blender/imbuf/intern/colormanagement.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/colormanagement.c	2012-09-24 18:14:55 UTC (rev 50856)
+++ trunk/blender/source/blender/imbuf/intern/colormanagement.c	2012-09-24 18:22:33 UTC (rev 50857)
@@ -1686,12 +1686,18 @@
 		if (allocate_result)
 			colormanaged_ibuf = IMB_dupImBuf(ibuf);
 
+		/* for proper check whether byte buffer is required by a format or not
+		 * should be pretty safe since this image buffer is supposed to be used for
+		 * saving only and ftype would be overwritten a bit later by BKE_imbuf_write
+		 */
+		colormanaged_ibuf->ftype = BKE_imtype_to_ftype(image_format_data->imtype);
+
 		/* if file format isn't able to handle float buffer itself,
 		 * we need to allocate byte buffer and store color managed
 		 * image there
 		 */
 		for (type = IMB_FILE_TYPES; type->is_a; type++) {
-			if (type->save && type->ftype(type, ibuf)) {
+			if (type->save && type->ftype(type, colormanaged_ibuf)) {
 				if ((type->flag & IM_FTYPE_FLOAT) == 0)
 					make_byte = TRUE;
 
@@ -1703,17 +1709,11 @@
 		colormanagement_imbuf_make_display_space(colormanaged_ibuf, view_settings, display_settings, make_byte);
 
 		if (colormanaged_ibuf->rect_float) {
-			if (make_byte && allocate_result) {
-				/* save a bit of memory */
-				imb_freerectfloatImBuf(colormanaged_ibuf);
-			}
-			else {
-				/* float buffer isn't linear anymore,
-				 * image format write callback should check for this flag and assume
-				 * no space conversion should happen if ibuf->float_colorspace != NULL
-				 */
-				colormanaged_ibuf->float_colorspace = display_transform_get_colorspace(view_settings, display_settings);
-			}
+			/* float buffer isn't linear anymore,
+			 * image format write callback should check for this flag and assume
+			 * no space conversion should happen if ibuf->float_colorspace != NULL
+			 */
+			colormanaged_ibuf->float_colorspace = display_transform_get_colorspace(view_settings, display_settings);
 		}
 	}
 




More information about the Bf-blender-cvs mailing list