Thumbs creation with queue

I am using GitHub - bvdputte/kirby-queue: A simple queue utility plugin for Kirby 3 and i would like to use it to generate thumbnails - the .jobs in media folder instead of running on page requests.

I can’t find what is running this thumbnail creation and if i can run it myself.

Thank you!

Thumbnails are created via the Darkroom class, in particular the process() method: $darkroom->process() | Kirby CMS.

But what exactly do you want to do? Maybe also look at the Media class and the tests for the Media class.

I will have to look at it with fresh eyes it has to do with this aswell kirby/components.php at 04127160ed1ab8dc277763cd8ba4ebc5a097bc18 · getkirby/kirby · GitHub

I wan’t to find some good solution to generating all thumbs in background. The problem i have since i’ve switched to multiple filetypes + responsive resolutions is that thumbs are very pretty slow even on my quite beefy server and it just looks wrong when you have x images that are not showing up.

If i understand it correctly right now whenever the thumbs function is called it creates .jobs inside media folder and existence of this file “approves” the thumb for creation so when the matching request is made kirby will create the thumb. (safety measure so anyone cannot just kill your server with requests to image versions)

Even if somebody visits the page they will create just few of the all possible thumb combinations.

So i want way to keep creating these .jobs in background until there aren’t any. Maybe it doesn’t have to be queue just some recursive function in page hook (that would probably have problems with timeouts). But in any case i would need function “getMediaJobAndCreateThumbnail”

I think this is going to be pretty common issue once people start hopping onto the multifile .avif train. avif takes ages