Download the PHP package innoweb/silverstripe-image-placeholders without Composer

On this page you can find all versions of the php package innoweb/silverstripe-image-placeholders. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-image-placeholders

Silverstripe Image Placeholders

Overview

Provides LQIP (low quality image placeholder) and GIP (greyscale image placeholder) including base64 encoded URL data.

It also contains a method for LCP LQIP described by Harry Roberts which lets you use a LQIP so that it counts as the LCP image and the hi-res image gets swapped in later on. Thanks Harry for this wizardry ;)

Requirements

Installation

Install the module using composer:

Then run dev/build.

Usage

Make sure that any resizing is done prior to generating the placeholder image.

Do: <img src="$Image.Fill(200,200).GIP.DataURL" width="200" height="200">

Don't: <img src="$Image.GIP.Fill(200,200).DataURL" width="200" height="200">

Lazy loading via Javascript

You can use these placeholders for images that are lazy loaded via Javascript, e.g.:

And then use lazysizes to load the images.

This uses the Base64 encoded data URL of the LQIP as a placeholder and then lazy loads the hi-res image.

Native lazy loading

You can also use these placeholders for images that are lazy loaded natively:

This uses the Base64 encoded data URL of the LQIP as a background of the image that is displayed while the actual image is loaded.

Placeholder for LCP image

Harry Roberts describes in a blog post how a LQIP can be set so that it counts as the LCP image and the hi-res image gets swapped in later on.

This module supports this behaviour with the LCPLQIP method.

You can set the bits per pixel (BPP) threshold described by Google using the following setting:

Per default this is set to 0.055, which gives the value defined by Google another 10% to be on the safe side.

To use the LCP LQIP image, preload the LQIP image and set it as background for the actual image:

This way, the LQIP image is already loaded when the page is rendered and the hi-res image is then downloaded and swapped in. (The CSS background colour is used as another fallback, in case the LQIP is not available yet.)

Because the LCPLQIP image is over the BPP threshold and the hi-res image has the same dimensions as the LCPLQIP image, the LCPLQIP image is counted as the LCP image instead of the hi-res image.

License

BSD 3-Clause License, see License


All versions of silverstripe-image-placeholders with dependencies

PHP Build Version
Package Version
Requires ext-gd Version *
silverstripe/assets Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package innoweb/silverstripe-image-placeholders contains the following files

Loading the files please wait ....