Extend thumb/image -> overlay/watermark method with async/jobs generation

I’ve spend literally days by now to work on ways to extend the thumb/image thumbnail component to have the overlay (simpleimage) method to work with the async thumbnail generation…

the most easiest way i found (for my knowledge) was to add it to focusCrop, while the overlay method worked that way, it seemed to break other things such as the usual methods (resize, crop) not outputting images anymore, even though no obvious errors can be seen…

Since this kinda ended in a dead end, i proceeded to check out to add a custom thumb component - where my goal is just to be able to run

$image->watermark()->url()

where it uses the jobs/async generation to not block rendering while computing those thumbnails.

browsing though the reference, and the forum it seems there are quite a few informations out there, but whatever i change in my plugin, it does not seem to take any effect, regardless of if i were to put intentional syntax errors or whatsoever.

I also tried overwriting the component / thumb generation in my plugin,

    'components' => [
        'thumb' => function (App $kirby, string $src, string $dst, array $options) {
            $rootToThumb = myThumbGenerator($src, $dst, $options);

            return $rootToThumb;
        }
    ]

but whatever change i made in the thumb / component function, it didn’t seem to take any effect. Even when putting syntax errors…

Anyone who has added own

// options hardcoding watermark image / position / output pixelsize would be fine at start
$image->method()->url()

// if methods are still chainable, would be the cherry on the icing
$image->method()->resize()->url();

which uses the jobs/aysnc generation can shed some light towards me?

the most easiest way i found (for my knowledge) was to add it to focusCrop, while the overlay method worked that way, it seemed to break other things such as the usual methods (resize, crop) not outputting images anymore, even though no obvious errors can be seen…

i guess i’ll try giving that another shot as my local server is running 7.3.1… @flokosiol