Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Automatically resize images on upload

Notifications You must be signed in to change notification settings

schnti/kirby3-autoresize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Autoresize plugin

A plugin for Kirby 3 CMS to shrink images on upload and replace to max size.

Resizing a huge image

Commercial Usage

This plugin is free but if you use it in a commercial project please consider

Installation

Download

Download the files and place them inside site/plugins/autoresize.

Git Submodule

You can add the plugin as a Git submodule.

$ cd your/project/root
$ git submodule add https://github.com/schnti/kirby3-autoresize.git site/plugins/autoresize
$ git submodule update --init --recursive
$ git commit -am "Add Kirby Autoresize plugin"

Run these commands to update the plugin:

$ cd your/project/root
$ git submodule foreach git checkout master
$ git submodule foreach git pull
$ git commit -am "Update submodules"
$ git submodule update --init --recursive

Composer

composer require schnti/autoresize

Options

You can change the default 1500px width in /site/config/config.php:

return [
  'schnti.autoresize.max' => 1500,
  'schnti.autoresize.customConfig', [
      'imagekit.lazy' => false // e.g. for use with https://github.com/fabianmichael/kirby-imagekit
  ]
];

How to use it

Nothing required. Plugin is using the file.create:after and file.replace:after Hooks from Kirby

About

Automatically resize images on upload

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%