Increase Thumbnail Size of *.blend files

Hi, are there any plans to increase the thumbnail of *.blend files? As far as I can see, the current resolution is 128x128. I am currently extracting the thumbnail and display it in a file browser, but it looks of course washed out beside other graphic files. I personally would prefer a thumbnail of 512x512 or greater.

Thank you!

Sebastian

2 Likes

I would love that, but it isn’t as easy as it seems. First a recap.

Whenever you save a blend file the thumbnail is created (an offscreen workbench render). It is rendered at 256x256 and then reduced to 128x128 to give it some antialiasing.

This 128x128 version is stored inside the blend file header. We can get to it easily without having to read the entire blend file. But it is stored there as an uncompressed bitmap. This means that increasing this size just to 256x256 would result in every blend file being 200 KB larger.

But technically File Browser does not extract blend file thumbnails from blend files, but instead uses the filesystem cache files - a directory of images for all the blend files, images, videos, etc. These are all 256x256 PNGs. This does mean that for the blend thumbs these are enlarged to this size from 128x128, which is why they don’t look as good as other thumbnails. Here is an experiment in rendering them a little differently: https://developer.blender.org/D9404

We can technically increase the file system thumbnails of blends to 256 while keeping the in-blend thumbs at 128, but that means you will see lower-res versions sometimes, like when you get a blend file from someone else: https://developer.blender.org/D10491

Personally, I would also like the blend thumbs to be 512x512, but only if they are stored compressed. But this change would break backward compatibility - older blender versions would probably have to get nothing. Would need some thought and planning. Here is an example of using the blend thumbnails in a “file loading” dialog: https://developer.blender.org/D10484

3 Likes

Thank you very much for the detailed explanation! It confirms my expectation I had why this is not that easy.

But technically File Browser does not extract blend file thumbnails from blend files, but instead uses the filesystem cache files

At the moment I extract the thumbnail from the *.blend files directly. If I understand you correctly, there is a second way? As mentioned, I am

Yes, if you have a path to a blend file you can extract the thumbnail from it directly by:

  BlendThumbnail *data;
  data = BLO_thumbnail_from_file(filepath);
  ImBuf *ibuf = BKE_main_thumbnail_to_imbuf(NULL, data);

But inside File Manager it is dealing with all sorts of thumbnail types. It instead calls something in thumbs.c that first checks the file system cache and loads the PNG from there if available. Can’t remember exactly what (IMB_thumb_create() or IMB_thumb_read() perhaps) but that file probably contains what you need.

1 Like

That is fantastic, thank you for your help!

1 Like

Hi,
I don’t understand much from the last 3 posts in this thread, but I also wanted to have larger thumbnails. Can you please explain me a bit that “extracting the thumbnail from .blend file”? Is this the way to get a larger thumbnail for a specific file? Sorry if my question is dumb. I’m not a dev and this is the only thread I found about this topic and I really wish I knew and understood what is going here :smiley:

No worries. Blender currently saves thumbnails of a certain size and we might eventually change that. But without being a developer, and altering your own version, there isn’t any other way to change that I’m afraid.

Okay, thank you for the explanation :slight_smile: