Download the PHP package fronty/responsive-images without Composer

On this page you can find all versions of the php package fronty/responsive-images. 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 responsive-images

RESPONSIVE IMAGES FOR WORDPRESS

Library that will make working with images in your responsive Wordpress template a breeze.

What's in the box:

Code

Output

Thanks a lot to Adam Laita and his post about image optimization (in Czech only). It was the original inspiration for this library.

Instalation

Option 1: with Composer

Recommended way to install the library is using Composer:

Include composer's autoload in functions.php:

Option 2: without Composer

  1. Download source code of the library and unzip it into your theme directory.
  2. Require files manually in functions.php

WP Plugins

  1. Install Fly Dynamic Image Resizer and activate it on local development version. You can use this on production as well, but you would miss the speed of CDN.

  2. On production version install, activate and configure Auto Cloudinary, which will automatically upload all your images to Cloudinary using it's fetch API.

This library decides whether to use Fly Dynamic Image Resizer or Auto Cloudinary plugin, but make sure only one of these plugins is activated at a time. If none of these plugins is activated, library will fall back to default Wordpress attachment getter wp_get_attachment_image_src() with size given as array.

The library can work with SVGs as well. To support SVGs in WP Media Library, install SVG Support.

With this, you are ready to instantiate all classes described below directly in your template files. However to optimize your images and code as much as possible, there are more steps suggested.

Working with image sizes

To work with responsive images, we first has to prepare one or more image sizes for various breakpoints. Image sizes can be defined using following classes:

See detailed documentation of these objects.

Working with images

Library includes two main classes for work with images:

See detailed documentation of these objects.

WP filters

Both ThemeImage and UploadImage objects allows you to change some of their outputs using WP filter mechanism.

See list of all filters available.

Dependencies

Nette\Utils

The code depends on lightweight utility classes from Nette\Utils, especially following classes:

Other dependencies


@todo


All versions of responsive-images with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
nette/utils Version ^4.0.0
enshrined/svg-sanitize Version ^0.16.0
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 fronty/responsive-images contains the following files

Loading the files please wait ....