[Bf-blender-cvs] [ff27b68f41c] master: Fix T101295: Allow Large Windows Thumbnails
Harley Acheson
noreply at git.blender.org
Fri Sep 23 23:51:04 CEST 2022
Commit: ff27b68f41ce511e162d6e561103c522d9507a5f
Author: Harley Acheson
Date: Fri Sep 23 14:49:36 2022 -0700
Branches: master
https://developer.blender.org/rBff27b68f41ce511e162d6e561103c522d9507a5f
Fix T101295: Allow Large Windows Thumbnails
Allow our Windows Thumbnail Handler to supply thumbnails up to the
maximum 256x256 size.
Differential Revision: https://developer.blender.org/D16051
Reviewed by Ray Molenkamp
===================================================================
M source/blender/blendthumb/src/blendthumb_win32.cc
===================================================================
diff --git a/source/blender/blendthumb/src/blendthumb_win32.cc b/source/blender/blendthumb/src/blendthumb_win32.cc
index 287710934e2..2acc8f20a12 100644
--- a/source/blender/blendthumb/src/blendthumb_win32.cc
+++ b/source/blender/blendthumb/src/blendthumb_win32.cc
@@ -171,8 +171,8 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
}
*pdwAlpha = WTSAT_ARGB;
- /* Scale down the thumbnail if required. */
- if ((unsigned)thumb.width > cx || (unsigned)thumb.height > cx) {
+ /* Scale up the thumbnail if required. */
+ if ((unsigned)thumb.width < cx && (unsigned)thumb.height < cx) {
float scale = 1.0f / (std::max(thumb.width, thumb.height) / (float)cx);
LONG NewWidth = (LONG)(thumb.width * scale);
LONG NewHeight = (LONG)(thumb.height * scale);
More information about the Bf-blender-cvs
mailing list