[Bf-blender-cvs] [240e721dd36] master: Fix T86210: No preview icons for non-8bit images

Philipp Oeser noreply at git.blender.org
Mon Mar 8 13:54:29 CET 2021


Commit: 240e721dd363dd894f585f33bfe6a9971cd7660a
Author: Philipp Oeser
Date:   Wed Mar 3 12:46:09 2021 +0100
Branches: master
https://developer.blender.org/rB240e721dd363dd894f585f33bfe6a9971cd7660a

Fix T86210: No preview icons for non-8bit images

It looks like we never generated correct icon previews for images with
float_rects (non-8bit-images). Images from the report were 16bit pngs.

In this case, `icon_preview_startjob` would return early (it only
checked if the ImBuf `rect` was NULL -- which is the case if it has a
`rect_float` instead). This is not neccessary since `icon_copy_rect` is
perfectly capable of taking float rects.

Now correct the check and only return early if both `rect` & `rect_float`
are NULL.

note: this will not refresh icon previews from existing files
automatically. For this, use File > Data Previews > Clear Data-Block
Previews.

Maniphest Tasks: T86210

Differential Revision: https://developer.blender.org/D10601

===================================================================

M	source/blender/editors/render/render_preview.c

===================================================================

diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 9811b7caa38..1b7209b164b 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -1342,7 +1342,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
        * already there. Very expensive for large images. Need to find a way to
        * only get existing ibuf */
       ibuf = BKE_image_acquire_ibuf(ima, &iuser, NULL);
-      if (ibuf == NULL || ibuf->rect == NULL) {
+      if (ibuf == NULL || (ibuf->rect == NULL && ibuf->rect_float == NULL)) {
         BKE_image_release_ibuf(ima, ibuf, NULL);
         return;
       }



More information about the Bf-blender-cvs mailing list