Optimize on upload doesn't seem to work (resize images)

I’m trying to use the new “optimize on upload” in Kirby v4.0.1 as described here and here to resize images to a maximum width or height of 1980px but it doesn’t work.
/blueprints/files/image.yml looks like this:

title: Image

  create:
    width: 1980
    height: 1980
    crop: true

accept: image/jpeg, image/png

fields:
  alt:
    label: Alt Text
    type: text

and i want to use it in my article template, /blueprint/pages/article.yml looks like this at that point:

       files:
            type: files    
            template: image

What am i doing wrong? I used the autoresize plugin in kirby v3, which still works, but i would still like to know how to get this new feature working.
Thank s for any hint.

Is that just a copy and paste issue or is your indentation wrong here, create should not be indented.

I tried both, indented and not. Same result, images keep their original size.

Which thumbs driver are you using?

I tested in a K4 Starterkit and this works for me (using standard gd driver). Haven’t tested with 4.0.1 yet.

I just found out that the file template is not being used. It falls back to default. When i add create to default.yml it works. Now i have to find out why the file-template is not being assigned on upload.

Is that a field or a section you are using there, not clear from the missing context…

Oh, it was a matter of wrong identation here as well. Excerpt:

  sidebar:
    width: 1/3
    sections:      
      settings:
        type: fields
        fields:
          tags:
            width: 1/2
            label: Tags
            type: tags  
            #...
            
          files:
            label: Bilder
            type: files    
            template: image

Now, putting it that way, assigns the right template to uploaded images.

  sidebar:
    width: 1/3
    sections:      
      settings:
        type: fields
        fields:
          tags:
            width: 1/2
            label: Tags
            type: tags  
            #...
                            
      files:
        label: Bilder
        type: files    
        template: image

But that results in old articles not showing any images (because the template is default.yml, not image.yml) do i have to manually assign the image-template to old files (about 400 images in 65 pages) or rather use a new page-template for the upcoming articles? Or is there a better way? What would you suggest. Thank you!

You can update the files programmatically ($file->changeTemplate()) to set the template, doing this manually would be a pain.

Thanks a lot!