DEV Community

loading...
Cover image for Umbraco image optimisation using PunkOptimise

Umbraco image optimisation using PunkOptimise

garpunkal profile image Gareth Wright ・1 min read

About a year ago, I build a simple plugin for Umbraco 8 that allows you shrink your image via TinyPNG or reduce the image size using ImageProcessor (which is built into Umbraco).

This allows the editor to decide how they want to optimise their images, rather than doing it automatically.

nuget

Install-Package punkOptimise.Core
Enter fullscreen mode Exit fullscreen mode

Basic Requirements

Umbraco 8.4+

Screenshots

Context Menu
image

Action Menu
image

Instructions

Install the nuget package:

Install-Package punkOptimise.Core
Enter fullscreen mode Exit fullscreen mode

Add the following config to your web.config:

<add key="punkOptimise:ReduceFileExtensions" value="jpg,jpeg" />

<add key="punkOptimise:ShrinkfileExtensions" value="png" />

<add key="punkOptimise:DefaultQuality" value="70" />

<add key="punkOptimise:TinyPng:ApiUrl" value="https://api.tinify.com/shrink" />

<add key="punkOptimise:TinyPng:ApiKey" value="" />
Enter fullscreen mode Exit fullscreen mode

Complete the TinyPNG developer API key registration: https://tinypng.com/developers

Add the key to the config above: punkOptimise:TinyPng:ApiKey

Repo

https://github.com/garpunkal/punkOptimise

Discussion (0)

pic
Editor guide