More options when uploading files such as name changes, resizing or compression through TinyPNG.

Overview

Kirby Upload Extended

More options when uploading files like name changes, resizing via Kirby or compression and optional resizing via TinyPNG. Thanks at this point also to @medienbaecker for Parts of the code for pure resize with Kirby. It is the best alternative when only pure resizing is needed during upload. https://github.com/medienbaecker/kirby-autoresize

The individual components of the plugin:

  • Name change and replacement
  • Kirby size change
  • Optimization of images by TinyPNG
  • Resizing with TinyPNG
  • Upload control for other file types

Note: this is my first plugin for Kirby. Small bugs here and there are possible.

Installation

Download and copy this repository to /site/plugins/upload-extended. Sorry, currently no Composer

Configuration and options

There are a few options for the plugin. Every single function can be enabled or disabled. Below are the default settings for the config.php.

return [
  'werbschaft.uploadExtended.rename' => true,
  'werbschaft.uploadExtended.excludeCharacters' => ['_','__','___','--','---'],
  'werbschaft.uploadExtended.kirbyResize' => true,
  'werbschaft.uploadExtended.maxWidth' => 2000,
  'werbschaft.uploadExtended.maxHeight' => 2000,
  'werbschaft.uploadExtended.quality' => 100,
  'werbschaft.uploadExtended.debug' => false,
  'werbschaft.uploadExtended.tinyPng' => true,
  'werbschaft.uploadExtended.tinyPngKey' => 'insert-here',
  'werbschaft.uploadExtended.tinyPngResize' => false,
  'werbschaft.uploadExtended.tinyPngResizeMethod' => 'thumb',
  'werbschaft.uploadExtended.excludeTemplates' => [],
  'werbschaft.uploadExtended.excludePages' => [],
  'werbschaft.uploadExtended.uploadLimit' => true,
  'werbschaft.uploadExtended.uploadLimitMegabyte' => 5, 
];

Options in detail

Option Type Function
rename Bool Should the files be renamed during upload
excludeCharacters Array Which strings should be replaced with a -
kirbyResize Bool Should images be checked for size when uploaded in Kirby and scaled down if necessary
maxWidth Int Maximum width of an image in pixels
maxHeight Int Maximum height of an image in pixels
quality Int Quality of the uploaded image
debug Bool If active, various details are output with each upload what was changed by the plugin
tinyPng Bool Should the images be optimized by the TinyPNG service during upload? Requires a valid API key
tinyPngKey String The valid API key of your account
tinyPngResize Bool Images can also be resized by TinyPNG. Attention: per resize this uses one credit extra
tinyPngResizeMethod String If the TinyPNG Resize is used, which method should be applied: https://tinypng.com/developers/reference/php#resizing-images
excludeTemplates Array Array of templates to exclude
excludePages Array Array of pages to exclude
uploadLimit Bool Should other files, except images, be checked for size when uploaded
uploadLimitMegabyte Int The Maximum Upload Limit. Files that are larger will be deleted immediately

Known problems and future

  • Replace files in combination with the Change name option makes problems
  • next version with individual Search and Replace for the name option
  • Display at TinyPNG how many KB were saved
You might also like...
DiscordLookup | Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more...
DiscordLookup | Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more...

DiscordLookup Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more... Website Getting Help Tool

Ratio plugin is a luck plugin. The more lucky you are, the more you win!
Ratio plugin is a luck plugin. The more lucky you are, the more you win!

Ratio Ratio plugin is a luck plugin. The more lucky you are, the more you win Features When you break a block (Cobblestone), it gives/puts you somethi

⚙️ A WordPress plugin to set WordPress options from a .env file.

dotenv A WordPress plugin to set WordPress options from a .env file. Any WPENV_ prefixed variables in the .env will be used to override the WordPress

Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options

Coder Metabox for WordPress Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options. Step 1 call coder-metabox.php file in functi

Replace, concat strings or change number fields permanently using Grid Options
Replace, concat strings or change number fields permanently using Grid Options

It's Pimcore Bundle to replace ,concat strings or change number fields permanently using Grid Options. It will save replaced strings directly in object.

[READ-ONLY] CakePHP Utility classes such as Inflector, Text, Hash, Security and Xml. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Utility Classes This library provides a range of utility classes that are used throughout the CakePHP framework What's in the toolbox? Hash A

Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Number to Bangla Number, Word or Month Name in Laravel | Get Wordpress Plugin Laravel package to convert English numbers to Bangla number or Bangla te

PocketMine-MP Plugin for converting items & blocks name to your language.
PocketMine-MP Plugin for converting items & blocks name to your language.

ConvertName PocketMine-MP Plugin for converting items & blocks name to your language. Usage Due to license issue, I don't put the language files direc

This project is very diverse and based upon many languages and libraries such as C++, Python, JavaScript, PHP and MQTT

ADMS-Real-time-project This project is very diverse and based upon many languages and libraries such as C++, Python, JavaScript, PHP and MQTT Advance_

Comments
Owner
Oli
Oli
CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

Sajjad 2 Aug 14, 2022
CloudFlare Image Resizing plugin for WordPress.

Cloudflare Image Resizing plugin for WordPress The current Cloudflare plugin for WordPress does not replace URL's automatically for you to use the Ima

Norbert Boros 43 Jan 7, 2023
Magento 2 Module to add simple image resizing capabilities in all blocks and .phtml templates

Magento 2 Image Resizer Magento 2 Module to add simple image resizing capabilities in all blocks and .phtml templates Installation $ composer require

Stämpfli AG 88 Apr 18, 2022
m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b

m4b-tool m4b-tool is a is a wrapper for ffmpeg and mp4v2 to merge, split or and manipulate audiobook files with chapters. Although m4b-tool is designe

Andreas 798 Jan 8, 2023
This component simplifies file validation and uploading.

This component simplifies file validation and uploading.

Brandon Savage 1.7k Dec 27, 2022
Laravel-Crowdin Integration - Automate translations uploading/downloading

Laravel-Crowdin Integration Automate uploading/downloading translations Installation Install the package via composer: composer require georgii-web/la

Joris van Willigen 0 May 25, 2022
Silverstripe-populate - Populate your database through YAML files

Populate Module This module provides a way to populate a database from YAML fixtures and custom classes. For instance, when a building a web applicati

Silverstripe CMS 22 Oct 3, 2022
This component changes the way Magento 2 generates Interceptor classes

ABOUT This component changes the way Magento 2 generates Interceptor classes (a mechanism that allows plugins to work together). Instead of generating

Creatuity Corp. 64 Dec 5, 2022
Joole Reflector - used to work with the properties of objects, their changes and merges

Joole Reflector allows you to change protected, as well as private properties of an object.

Ravil Sitdikov 1 May 7, 2022