for thumbnail generation only scale the byte buffer. (was scaling float & byte).
authorCampbell Barton <ideasman42@gmail.com>
Fri, 8 Apr 2011 03:56:15 +0000 (03:56 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 8 Apr 2011 03:56:15 +0000 (03:56 +0000)
source/blender/imbuf/intern/thumbs.c

index 20276aede5c00bf63cd0fe12846508ca4e495d56..1f2eebbedc09b608175e2b5fda7bf13c001e1d09 100644 (file)
@@ -335,6 +335,15 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
                        ex = (short)scaledx;
                        ey = (short)scaledy;
                        
+                       /* save some time by only scaling byte buf */
+                       if(img->rect_float) {
+                               if(img->rect == NULL) {
+                                       IMB_rect_from_float(img);
+                               }
+
+                               imb_freerectfloatImBuf(img);
+                       }
+
                        IMB_scaleImBuf(img, ex, ey);
                }
                BLI_snprintf(desc, sizeof(desc), "Thumbnail for %s", uri);