Too much thumbnails
Just got a new site to manage from a different host (and builder). When looking at the files directory I saw that the thumbnails folder was over 2GB. It seems that the developer has created multiple (like 15 or so) predefined thumbnails. Some of which are images larger than 2800 pix! Not sure why, but it is....
I also found out that much images are not used as soecific predefined thumbs, but a thumb is created anyway! So one image used as small logo in the footer has 15 thumbnails, sometimes larger than 4MB.
So, my question is... Can thumbs be generated only when needed? If so? How?
Do it the "old" way?
Your other choice is to use the legacy thumbnailer so you'll have thumbnails on demand, but that also has its cons like slow loading pages if you have many images on that page.
I can't speak for anyone else, but in my case I would rather have one user waiting a little bit longer than a thumbnail folder of 2GB! It's only one time, once the thumb is generated the waiting is over for all :)
We all agree that, if we want to be able to set certain thumbnail types to apply only to selected files, the best way to do that is by using the already existing system of sets and folders.
What we don't agree on is should it be the sets or should it be the folders and then, should thumbnail types be attached to sets or folder or should we attach sets and folders to thumbnail types.
The problem is each has its own set of cons and pros.
Secretely, I think that if one of us just went ahead and made a decision, built it, and offered a pull request, that would probably be adopted. But it hasn't happened yet
I think we need to see it from the users / webmasters point-of-view or rather point-of-use. What is the easiest way for the user to handle stuff like this. A user just wants to upload a file and use it any where on his (or her) site. They don't want to "pre-select" the way it's going to be used. So in that case on-the-fly should be best. I think...
A file can belong to many sets but can only belong to 1 folder.
So if we link a thumbnail type to a folder, all files that need to be resized using that thumbnail type have to be in that folder and can't be in any other folder.
That would be a problem.
So if we went for folders, we would have to attach folders to thumbnail types and not attach thumbnail types to folders.
And then, of course, we are left with dealing with files that are not in folders and files that are in folders that are not attached to any thumbnail type. Should they be resized to all sizes? Should they not be resized at all?
Then do the same reasoning with sets.
Here is the GitHub issue discussion.
"Conditional thumbnails #3559"
To show your interest, I recommend giving the issue a thumbsup and leaving a comment.
Finding a way to avoid unnecessary thumbnail creation would be very useful and open the door to all sorts of new ways to use images. The current approach, like you have encountered, creates a lot of unused files.