Open curtchan opened 5 years ago
I personally don't mind the few extra bytes, and WordPress itself is very generous when it comes to storing images. Also you don't have to wait for regeneration of all your images when switching to a different placeholder style.
I do understand that there's a lot of data created, especially on image-heavy sites or large blogs, but I have a feeling that there are other areas for optimization, with a larger lever.
Well, i'm always looking at such things from optimization point of view, keeping in mind that some websites i deal with have thousands of images, iterating through each and instantiating 4 Imagick objects (and operating on them) will definitely take longer than doing same just once if needed, would have to stress-test it though to see if the difference is worth rewriting it.
I’m also using the plugin on a page with thousands of images. The regeneration was only necessary once at the beginning. When uploading new pictures the dominant color calculation and thumbnail generation isn’t noticeable. If I ever want to switch to a different placeholder style it happens instantaneously.
Your suggestion is worth looking into, but I personally don’t have the time for it right now. I'd be happy if you or the community wants to take this on ;)
Analyzed whole thumbnail generating flow.
I'd suggest, instead of generating 4 thumbnails - generating only one + storing type of it.
If user changes in config thumbnail type - notify that images require regenerating.
It should speed up whole generating process and limit DB usage.