DEV Community

Cover image for Umbraco 8 - Image optimisation using PunkOptimise
Gareth Wright
Gareth Wright

Posted on • Updated on

Umbraco 8 - Image optimisation using PunkOptimise

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

GitHub logo garpunkal / punkOptimise

A package for Umbraco that allows you to optimise your media using different providers.

Top comments (0)