Page MenuHome

Fix T101295: Allow Large Windows Thumbnails
ClosedPublic

Authored by Harley Acheson (harley) on Sep 23 2022, 8:32 PM.

Details

Summary

Allow our Windows Thumbnail Handler to supply thumbnails up to the
maximum 256x256 size.


As shown in the video in T101295, the Windows OS can request thumbnails that are larger than we currently provide. Ours are 128x128 while Window supports thumbnails up to 256x256.

Within our Thumbnail Handler we currently do something that is not recommended. We are scaling down our thumbnails if they are bigger than the passed resolution argument. But MS docs recommend leaving scaling down to the OS, and that the passed resolution is supplied in order for us to select from multiples, if he have such, and give the most suitable.

This patch just alters the code so that we no longer scale down if our thumbnail is larger than will be shown, but does scale UP if too small.

With patch applied, and after clearing my Windows Thumbnail Cache using cleanmgr.exe, showing Blend thumbnails at 256x256:

Otherwise the OS will just fit the supplied size (128x128) into a larger box with lots of wasted space instead:

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Sep 23 2022, 8:32 PM
Harley Acheson (harley) created this revision.

This patch just alters the code so that we no longer scale down if our thumbnail is larger than will be shown, but does scale UP if too small.

if the OS can scale down, can it scale up as well? do we *need* to do any scaling or can we just leave it to the OS?

@Ray Molenkamp (LazyDodo) - If the OS can scale down, can it scale up as well? do we *need* to do any scaling or can we just leave it to the OS?

No, I added another capture in the description above to show how it looks without the patch. Basically at maximum zoom level if just uses the thumbnails at 128x128 and results in a lots of empty space.

source/blender/blendthumb/src/blendthumb_win32.cc
175

Think this still needs to be ||?

source/blender/blendthumb/src/blendthumb_win32.cc
175

I might be thinking about it wrong. But if the OS says "Hey I want one that works with 256x256" and we've got one that is 100x300 then we don't need to scale it up.

Ray Molenkamp (LazyDodo) added inline comments.
source/blender/blendthumb/src/blendthumb_win32.cc
175

i figured we'd need to scale it up to 256x768 to hit the minimum width, but yeah if the OS will just scale it down again I guess it's kinda moot

This revision is now accepted and ready to land.Sep 23 2022, 10:31 PM
Harley Acheson (harley) marked 2 inline comments as done.Sep 23 2022, 11:33 PM