ElkArte Community

Elk Development => Feature Discussion => Topic started by: radu81 on May 31, 2018, 05:34:22 pm

Title: Thumbnail folders after changing width and height of thumbnails
Post by: radu81 on May 31, 2018, 05:34:22 pm
In Attachments settings I chaged the max width and max height of thumbnails, and as expected the image thumbnails were re-created. I also use multiple directories (subdivided by year and month) to store attachments and I set a limit of 5000 files per folder. I never arrive to that value, I usually get about 200-300 attachments/month.
Today I got a mail that attachments directory is full, I checked the folders and I noticed that the current directory has 5000 files, most of them are the newly thumbnails created. I solved the problem by setting the number of files per folder to 0.

I am wondering, is this how it supposed to work? If an image attachment inserted on 05/2016 is saved into /attachments/2016/05 when re-creating the new thumbnail shouldn't be saved on the same folder instead of current folder?
Title: Re: Thumbnail folders after changing width and height of thumbnails
Post by: Spuds on June 01, 2018, 09:21:09 am
I'll look at any bug except anything that has to do with attachment folders as that code is pure evil !!
Title: Re: Thumbnail folders after changing width and height of thumbnails
Post by: radu81 on June 01, 2018, 09:57:11 am
O:-)  don't waste too much time on this, not worth it ;)
Title: Re: Thumbnail folders after changing width and height of thumbnails
Post by: emanuele on June 01, 2018, 04:22:44 pm
Since that code was one of my first SMF mods (the 3rd submitted to be precise) I'm pretty sure the code could have been much better.
Then I became lazy (well, I was lazy even at that time) and I integrated it into 2.1 I think without much changes.

I'm pretty sure the code is intended to work like that in order to save some hassles to the developer.
Title: Re: Thumbnail folders after changing width and height of thumbnails
Post by: radu81 on June 01, 2018, 06:50:19 pm
Thank you both for the explanation ;)