PHPackages                             dft/silverstripe-deferedimages - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. dft/silverstripe-deferedimages

ActiveSilverstripe-vendormodule[Image &amp; Media](/categories/media)

dft/silverstripe-deferedimages
==============================

Deferres loading of template images

1.2.0(1y ago)517814BSD-3-ClausePHP

Since Jun 20Pushed 1y ago3 watchersCompare

[ Source](https://github.com/Dean-Forest-Tech/silverstripe-deferedimages)[ Packagist](https://packagist.org/packages/dft/silverstripe-deferedimages)[ Docs](http://github.com/Dean-Forest-Tech/silverstripe-deferedimages)[ RSS](/packages/dft-silverstripe-deferedimages/feed)WikiDiscussions 1 Synced 1mo ago

READMEChangelogDependencies (4)Versions (14)Used By (4)

Silverstripe Defered Images Module
==================================

[](#silverstripe-defered-images-module)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/244ed01254a3a6dd23e21556bef517e5b43247f440e30d06582664a084add101/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f692d6c61746572616c2f73696c7665727374726970652d64656665726564696d616765732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/i-lateral/silverstripe-deferedimages/?branch=master)

Module that loads images as a very low res version first, then uses JavaScript to load the full version

Now implements [heyday/silverstripe-responsive-images](https://github.com/heyday/silverstripe-responsive-images) without any extra configuration. Simply configure the responsive images module as you normally would and call them in the template.

Installation
------------

[](#installation)

install via composer

```
composer require i-lateral/silverstripe-deferedimages

```

Setup
-----

[](#setup)

By default this is added to the `PageController` if it's available. This can be added to extra controller via config.yml:

```
:
  extensions:
    - DFT\SilverStripe\DeferedImages\ControllerExtension

```

### Theme

[](#theme)

This module has a small theme addon that needs to be added you your theme stack in config.yml to load it's template.

```
SilverStripe\View\SSViewer:
  themes:
    - 'custom' //your_theme
    - 'deferedimages'
    - '$default'

```

Alternatively, you can copy the template into your own theme.

Configuration
-------------

[](#configuration)

By default all images called in the templates using the standard `$Image.Type()` call will be defered.

The temporary image can be customised in size, quality and appearance via config:

```
DFT\SilverStripe\DeferedImages\DeferedImage:
    pixelate: 15 // Applies a pixelation effect to the current image with a given size of pixels.
    blur: 50 // Apply a gaussian blur filter with a optional amount on the current image. Use values between 0 and 100.
    quality: 10  // Define the quality of the encoded image. Data ranging from 0 to 100.
    scale: 100 // Will resize the image to a percentage amount. 100 = current size, 50 = half size, etc.
    limit: 1000 // sets a maximum width for the defered image - will force scaling if original image is larger than this.

```

To enable deferring of images added in a `HTMLEditorField` you will need to enable the included shortcode parser via \_config.php:

```
