How to compress images uploaded via Kirby Editor


I’m trying to automatically compress all images I upload using the editor field on my blog. I’ve tried copying the Autoresize plugin into my site/plugins directory but when I upload files using the image block in the editor I don’t see any file size changes. I’ve reduced the default settings in the plugin to the values below and still don’t notice any difference in file sizes.

return [
  'medienbaecker.autoresize.maxWidth' => 1000,
  'medienbaecker.autoresize.maxHeight' => 1000,
  'medienbaecker.autoresize.quality' => 50,
  'medienbaecker.autoresize.excludeTemplates' => [],
  'medienbaecker.autoresize.excludePages' => [],

The plugin doesn’t have any other directions about how to use it, so I can’t tell if I’m missing anything. Am I doing anything wrong, is there a better way to do this?

The images you are uploading are greater than 1000 x 1000? This is a hook that wont actually kick in unless one of the edges is greater than 1000 (according to how you set it).

I’m not sure if it works with the Image Block.

@jimbobrjames thanks for pointing me in this direction! The image I was using to test was a large file but was less than 1000 x 1000. I’ve tried with a larger image from unsplash now and it works perfectly.

The plugin in works fine with the image block as well.

Thank you!