2017 © Pedro Peláez
 

library imagesrespond

On-the-fly responsive images

image

agilepixel/imagesrespond

On-the-fly responsive images

  • Monday, July 16, 2018
  • by code418
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

ImagesRespond

Build Status Coverage Status, (*1)

A quick drop-in PHP library to output scaled images for responsive purposes, (*2)

Usage

You have a large image with the following url, (*3)

http://my.site/img/my_large_image.png, (*4)

Once installed and configured, you can return a scaled version of this image with a width of 200px by amending the requested url:, (*5)

http://my.site/img/respond-200-my_large_image.png, (*6)

If you need the scaling to be based on height instead of witdh use the following:, (*7)

http://my.site/img/respond-200h-my_large_image.png, (*8)

Installation via Composer

composer require agilepixel/imagesrespond, (*9)

Configure for Apache

Enter into your server configuration or .htaccess, customise based on your desired configuration, (*10)

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} respond-[0-9]+h?-.*\.(jpg|gif|png|webp|jpeg)$
RewriteRule ^(.*)$ vendor/agilepixel/imagesrespond/src/rewrite.php [L]

### Configure for Nginx, (*11)

Enter the following into your Nginx server configuration, customise based on your desired configuration, (*12)

rewrite respond-([0-9]+)h?-.*\.(jpg|gif|png|webp|jpeg)$ /vendor/agilepixel/imagesrespond/src/rewrite.php last;

The Versions

16/07 2018

dev-master

9999999-dev

On-the-fly responsive images

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Brown

16/07 2018
16/07 2018
08/03 2018

v0.0.1

0.0.1.0

On-the-fly responsive images

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Brown