Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-08-06 22:33:15

musouka
Member
Registered: 2024-08-06
Posts: 5

How to force large thumbnails in Thunar?

Hello!

I am looking for a way to force Thunar to always generate large (256x256) thumbnails regardless of the zoom level I am using.  I have looked at the documentation for both Thunar and tumbler as well as many Google searches, with no luck.

If anyone knows of a way to force Thunar to always use large thumbnails I would be very grateful for your help!

Offline

#2 2024-08-06 23:36:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: How to force large thumbnails in Thunar?

Hello and welcome.

I am looking for a way to force Thunar to always generate large (256x256) thumbnails regardless of the zoom level I am using.

Why do you want to generate a thumbnail for a view that is not displayed in thunar? What is your use case? The thumbnail will be generated when you select the correct zoom size.

If anyone knows of a way to force Thunar to always use large thumbnails I would be very grateful for your help!

What version of Xfce and thunar are you running? On recent versions, make sure that "Remember view settings for each folder" is unchecked, and then resize to icon to the preferred size. It will maintain the size from folder to folder.

Or perhaps I'm misunderstanding what you trying to accomplish.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-08-07 20:49:41

musouka
Member
Registered: 2024-08-06
Posts: 5

Re: How to force large thumbnails in Thunar?

Thank you for your reply.

Why do you want to generate a thumbnail for a view that is not displayed in thunar? What is your use case?

I normally browse files at 100%/default zoom level, but often need to browse directories with many images and videos and prefer to use a larger zoom level for those.  I don't want thumbnails to be generated at the normal/small size as this will just take up extra space on my drive when I am just going to increase the zoom for those directories anyway.  The option to remember settings for each directory also will not work in my use case as the directories often change.

Therefore, I need a way to force Thunar to always generate thumbnails at the large size so that it does not generate the normal/small size thumbnails if I enter one of those directories while at the default zoom level before I have a chance to increase the zoom.

Alternatively, if there is a way to set Thunar to never automatically generate thumbnails but still use ones that are already generated, that would work as well.

What version of Xfce and thunar are you running?

Ubuntu version: 22.04.4 LTS
Xfce version: 4.18
Thunar version: 4.18.3

Offline

#4 2024-08-07 23:28:27

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: How to force large thumbnails in Thunar?

musouka wrote:

Therefore, I need a way to force Thunar to always generate thumbnails at the large size so that it does not generate the normal/small size thumbnails if I enter one of those directories while at the default zoom level before I have a chance to increase the zoom.

Thunar doesn't create thumbnails - its the job of the tumbler package to do this.

Alternatively, if there is a way to set Thunar to never automatically generate thumbnails but still use ones that are already generated, that would work as well.

Here is something that you can try. I haven't tested it, but it should work in theory.

First, create the directory ~/.local/share/thumbnailers.

All of your existing thumbnailers are located in /usr/share/thumbnailers. If you view the content of one of those file, you will see an Exec= line. The -s parameter sets the size of the thumbnail and you can see that its passed a variable "%s" from tumbler. You can change this to whatever size you want.

So, the process goes like this (lets test with the video thumbnailer).

  1. copy /usr/share/thumbnailers/ffmpegthumbnailer.thumbnailer to ~/.local/share/thumbnailers

  2. edit the file and replace the %s with the size of the thumbnail that you want (e.g. 512)

  3. log out and back in again to test

Test both with large and small icon sizes to see if it works properly. If it does, I believe image files are managed by the gdk-pixbuf-thumbnailer.thumbnailer, but it might vary depending on what other thumbnailers are installed in your system.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2024-08-08 08:52:44

musouka
Member
Registered: 2024-08-06
Posts: 5

Re: How to force large thumbnails in Thunar?

Thank you for the suggestion.  Unfortunately it did not work.

I tried the method you suggested as well as modifying the .thumbnailer files directly inside the /usr/share/thumbnailers directory.  With each attempt I deleted the existing thumbnail cache and fully rebooted the PC.  Despite manually specifying 256 as the pixel size inside the .thumbnailer files, 128 pixel "normal" thumbnails were still generated when viewing the directory at the default zoom level and 256 pixel "large" thumbnails were generated only when viewing at an increased zoom level.

Thunar doesn't create thumbnails - its the job of the tumbler package to do this.

As I understand it, this is correct except that Thunar tells tumbler what size to make the thumbnails and where to output the file.  Thunar also chooses which directory (normal or large) to look in for thumbnails based on the zoom level that is being used.  This is the behavior that I need to modify.  I need Thunar to always tell tumbler to make 256 pixel thumbnails and always use the large directory so that it doesn't create duplicate smaller thumbnails in the normal directory.

Do you have any suggestions on how I might accomplish this?

Offline

#6 2024-08-08 10:09:25

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: How to force large thumbnails in Thunar?

If thunar is making the call for the thumbnail size then I'm not sure this level of control is currently possible with thunar itself.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2024-08-08 11:22:43

Misko_2083
Member
Registered: 2015-10-13
Posts: 211
Website

Re: How to force large thumbnails in Thunar?

https://docs.xfce.org/xfce/tumbler/avai … humbnailer
Maybe thumbler can be set to run custom command like ImageMagick command instead of built-in plugin.


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#8 2024-08-08 14:36:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: How to force large thumbnails in Thunar?

Misko_2083 wrote:

https://docs.xfce.org/xfce/tumbler/avai … humbnailer
Maybe thumbler can be set to run custom command like ImageMagick command instead of built-in plugin.

That's an interesting suggestion, Misko. You might be able to disable all thumbnailers and create your own custom thumbnailer to only create large thumbnails.

But I'm not sure how it would use the larger thumbnail to thumbnail at smaller sizes.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2024-08-08 15:37:17

Misko_2083
Member
Registered: 2015-10-13
Posts: 211
Website

Re: How to force large thumbnails in Thunar?

I think the custom thumbnailer script would have to handle smaller thumbnails as well.
And also fit the Thumbnail Managing Standard https://specifications.freedesktop.org/ … ctory.html
https://specifications.freedesktop.org/ … lures.html
When thunar requests a size custom thumbnailer would create the desired size.

!/bin/bash

input_file="$1"
output_file="$2"
size="$3"

# Determine the directory based on size
if [ "$size" -ge 256 ]; then
    output_dir="$HOME/.cache/thumbnails/large"
    size=256
elif [ "$size" -ge 128 ]; then
    output_dir="$HOME/.cache/thumbnails/normal"
    size=128
else
    output_dir="$HOME/.cache/thumbnails/normal"
    size=64
fi

# Ensure the directory exists
mkdir -p "$output_dir"

# convert command goes her
# if fails it should create empty file as in Specs

And then you set exec line in the custom thumbnailer configuration:
Exec=~/.local/bin/custom-thumbnailer.sh %i %o %s
If thunar doesn't request a larger thumbnail, script could be modified to make it.

Last edited by Misko_2083 (2024-08-08 15:40:57)


Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

#10 2024-08-08 20:24:51

musouka
Member
Registered: 2024-08-06
Posts: 5

Re: How to force large thumbnails in Thunar?

Thank you ToZ and Misko for the effort you've put into helping me figure this out.

The custom script idea is a good one, however, it seems that would still end up generating the smaller size thumbnails which is what I am trying to avoid.  I realize the script could be modified to only generate the large thumbnails, but I'm not sure how this functionally differs from trying to modify the command used with the existing thumbnailers.

I'm also quite confused on exactly how Thunar is making calls to tumbler because it appears to completely ignore any settings I manually specify in the .thumbnailer files.  So, I'm not sure how I would interrupt that process to make it run the custom script instead.  If this part could be figured out, then I feel like modifying the command for the existing thumbnailers would work.

Offline

#11 2024-08-08 22:27:36

musouka
Member
Registered: 2024-08-06
Posts: 5

Re: How to force large thumbnails in Thunar?

After further testing, I have solved this issue by taking a different approach.

Rather than trying to modify the behavior of Thunar, tumbler, or any of the individual thumbnailers, I simply turned ~/.cache/thumbnails/normal into a read-only mount point for ~/.cache/thumbnails/large.

This has satisfied all of my desired requirements.

Thunar and tumbler will be unable to generate 128 pixel thumbnails as the normal directory is now read only.
The 256 pixel thumbnails will still be generated normally.
Once the 256 pixel thumbnails are generated Thunar will read and use them regardless of the zoom level I am using.

Thank you again ToZ and Misko for your efforts in helping on this.

This issue can be marked as solved.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 594.84 KiB (Peak: 612.13 KiB) ]