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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-09-24 22:22:33 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-09-24 22:22:33 +0400
commit17dc6e7c041adad57a6b038975aa3d2e7ba967ca (patch)
tree90087db0c1bfd8ab057d81f8eb99a4622dedb617 /source/blender/imbuf
parent765865c3b18f75b1d5e2bc544c70322042ced2b9 (diff)
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.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/colormanagement.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 91eb1f5153e..0f1a880fb75 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -1686,12 +1686,18 @@ ImBuf *IMB_colormanagement_imbuf_for_write(ImBuf *ibuf, int save_as_render, int
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 @@ ImBuf *IMB_colormanagement_imbuf_for_write(ImBuf *ibuf, int save_as_render, int
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);
}
}