Skip to content

avif files do not get cropped or resized #74

@trych

Description

@trych

Hi there!

Thanks for the great plugin.

I have some srcset options like this:

  'flokosiol' => [
    'focus' => [
      'srcsets' => [
        'default' => [
          '300w'  => ['width' => 300, 'height' => 200],
          '600w'  => ['width' => 600, 'height' => 400],
          '900w'  => ['width' => 900, 'height' => 600]
        ],
        'avif' => [
          '300w'  => ['width' => 300, 'height' => 200, 'format' => 'avif'],
          '600w'  => ['width' => 600, 'height' => 400, 'format' => 'avif'],
          '900w'  => ['width' => 900, 'height' => 600, 'format' => 'avif']
        ],
        'webp' => [
          '300w'  => ['width' => 300, 'height' => 200, 'format' => 'webp'],
          '600w'  => ['width' => 600, 'height' => 400, 'format' => 'webp'],
          '900w'  => ['width' => 900, 'height' => 600, 'format' => 'webp']
        ],
      ]
    ]
  ]

While this works when I just use the webp options, it does not work when I use the avif options. This works neither for the .webp files nor for the .avif files. (Edit #2: It does work for the .webp files, but only when the thumbs driver is set to gd, if it's set to im no format works, not even regular jpg.) It does create .avif/.webp with file names like image-300x200-crop-50-50.avif but the result is an avif of the original resolution.

Thanks for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions