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:
authorHarley Acheson <harley.acheson@gmail.com>2021-09-06 05:55:50 +0300
committerHarley Acheson <harley.acheson@gmail.com>2021-09-06 05:55:50 +0300
commitbf0ac711fde2e0439af117f73ab1b3a758969348 (patch)
tree548fddd0106b35eeb4a539846b2a131cfff98afd /source/blender/windowmanager
parent4ddad5a7ee5d9c3245593c509714f8c1359f9342 (diff)
UI: Increase Size of Blend File Thumbnails
Increase effective resolution of blend preview images from 128x128 to 256x256 for versions saved in the file system thumbnail cache. See D10491 for details and examples. Differential Revision: https://developer.blender.org/D10491 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index f83511e76f0..8eaac47471a 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1573,8 +1573,8 @@ static ImBuf *blend_file_thumb(const bContext *C,
NULL,
OB_SOLID,
scene->camera,
- BLEN_THUMB_SIZE * 2,
- BLEN_THUMB_SIZE * 2,
+ PREVIEW_RENDER_LARGE_HEIGHT * 2,
+ PREVIEW_RENDER_LARGE_HEIGHT * 2,
IB_rect,
V3D_OFSDRAW_NONE,
R_ALPHAPREMUL,
@@ -1588,8 +1588,8 @@ static ImBuf *blend_file_thumb(const bContext *C,
OB_SOLID,
v3d,
region,
- BLEN_THUMB_SIZE * 2,
- BLEN_THUMB_SIZE * 2,
+ PREVIEW_RENDER_LARGE_HEIGHT * 2,
+ PREVIEW_RENDER_LARGE_HEIGHT * 2,
IB_rect,
R_ALPHAPREMUL,
NULL,
@@ -1610,8 +1610,14 @@ static ImBuf *blend_file_thumb(const bContext *C,
if (ibuf) {
/* dirty oversampling */
- IMB_scaleImBuf(ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
- thumb = BKE_main_thumbnail_from_imbuf(NULL, ibuf);
+ ImBuf *thumb_ibuf;
+ thumb_ibuf = IMB_dupImBuf(ibuf);
+ /* BLEN_THUMB_SIZE is size of thumbnail inside blend file: 128x128. */
+ IMB_scaleImBuf(thumb_ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
+ thumb = BKE_main_thumbnail_from_imbuf(NULL, thumb_ibuf);
+ IMB_freeImBuf(thumb_ibuf);
+ /* Thumbnail saved to filesystem should be 256x256. */
+ IMB_scaleImBuf(ibuf, PREVIEW_RENDER_LARGE_HEIGHT, PREVIEW_RENDER_LARGE_HEIGHT);
}
else {
/* '*thumb_pt' needs to stay NULL to prevent a bad thumbnail from being handled */