Nevermind, {{ transform }} works for picture element and srcset.


It would be great if the file fieldtype allowed you to set multiple sizes of the same image, resulting in have multiple sizes of one image for use with the picture element or srcset.

I'm thinking something like this:

my_image:
  type: file
  destination: /assets/img/
  allowed: [jpg]
  resize:
    small:
      height: 150
      width: 300
      quality: 60
      upsize: false
    medium:
      height: 300
      width: 600
      quality: 75
      upsize: false
    large:
      height: 500
      width: 1000
      quality: 80
      upsize: false

Then this would result in the following files: image_name_small.jpg image_name_medium.jpg image_name_large.jpg

Answered by Jason Varga! Go to answer.