Download the PHP package otago/silverstripe-retinaimages without Composer
On this page you can find all versions of the php package otago/silverstripe-retinaimages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download otago/silverstripe-retinaimages
More information about otago/silverstripe-retinaimages
Files in otago/silverstripe-retinaimages
Package silverstripe-retinaimages
Short Description An add-on for adaptive images.
License BSD-3-Clause
Homepage https://github.com/otago/silverstripe-retina-images
Informations about the package silverstripe-retinaimages
Retina images
An add-on for adaptive images
Makes your images look crisp and sexy on high DPI devices.
Usage
- run
- run ?flush=1 on your page
All images used in your WYSIWYG editor should now be retina upscaled images
using srcset. you can check this by inspecting your tags
Using retina in the template
If you want retina images in your template, you specify this with prefixing all image functions with retina.
For example, $Image.Fill(50,50) becomes $Image.RetinaFill(50,50)
How it works
Allows support for high-resolution displays by automatically creating different assets representing the same image. It specifies bitmapped images by adding a srcset attribute to the img element, as specified by the W3C draft http://www.w3.org/html/wg/drafts/srcset/w3c-srcset/
When creating a generated image it creates three different images, scaled up to the following factors: 1.0x, 1.5x, and 2.0x. The default generated image is also created, which is used as the src attribute. These image urls are then placed into the srcset tag.
It does it out the box on through the template, WYSIWYG requires a modification to your getCMSFields() method.
srcset Polyfills
Older browsers require a polyfill. All modern browsers support the tag
https://github.com/borismus/srcset-polyfill/ https://github.com/culshaw/srcset http://jimbobsquarepants.github.io/srcset-polyfill/