I am having a php script, it generates an image, based on fields of my page. It uses text fields and also a files field for a background image. It works good! But, when I want it to use a cropped image
$bgImage->thumb(['width' => 1200, 'height' => 628, 'crop' => true]);
it does not work.
By clearing media folder and carefully watching I found out: It only creates .job/*.json of the image but it is not creating the media file.
When I render <img src="<?=$bgImage->thumb(['width' => 1200, 'height' => 628, 'crop' => true])->url()?>">
somewhere in my template. It is created and then also the image-generator-script can display it.
I worked around by adding file_get_contents($bgImagePath->url());
to my script. It creates the media. But I am wondering, am I doing something wrong?