Newbie question about $image->srcset() method

Dear all,

first time Kirby user here with a presumably easy to answer question. Here it comes:

I’understand from the guide Kirby is capable of cropping and resizing images on the fly. One of the methods listed on the guide page is $image->srcset. But I wonder what it actually does? Does it

  • actually generate the physical image files required together with the definitions
    OR
  • does it generate the definitions only (while the files (“thumbs”) must be generated with another method)?

I’d a look inside the /media folder and it only contains a collection of .json files but no .jpg, so I assume the latter is correct? If so, what’s the best way to generate the required files?

Thanks for pointing me in the right direction!

The srcset method creates a set url image urls (and job .json files) that when called then generate the corresponding thumbs on the fly.

That means, the thumbs are only generated when actually needed.

1 Like

Thank you :grinning_face_with_smiling_eyes: