Download the PHP package heyday/silverstripe-optimisedimage without Composer

On this page you can find all versions of the php package heyday/silverstripe-optimisedimage. 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-optimisedimage

SilverStripe Optimised Image

This module provides two image manipulation services that can be configured independently:

For a SilverStripe 2.4 version check the 0.1 branch.

Configurations for some common image optimisation tools (eg. jpegoptim and optipng) are provided as part of this module, though any command line program can be used with the image optimisation service. No optimisation program binaries are bundled with this module, so you'll need to install any programs you want to use on the target system.

Note that only resampled images are optimised by the optimisation service module (eg. using CroppedImage, SetWidth, SetHeight, PaddedResize, etc). If you want to optimise images without resizing them, there is currently a workaround to trigger optimisation.

Installation (with composer)

$ composer require heyday/silverstripe-optimisedimage

Usage

Resampling Images on upload

By default, resampling on upload is not enabled. To activate it, the ResampleImage extension needs to be added to Image. In your mysite/_config/config.yml add:

The default maximum width & height for uploaded images is 1024 x 1024 pixels. Images larger than this will be scaled to fit their largest dimension to this size.

You can set your own maximum height and width for uploaded images by overriding the default config in your mysite/_config/config.yml:

Note that resampling on upload is a destructive process: the original uploaded image is discarded.

Optimising SilverStripe Resampled Images - Selecting a backend

The image backend that SilverStripe uses needs to be changed to either OptimisedGDBackend or OptimisedImagickBackend depending on whether you want to us GD or Imagick. To do this, in your mysite/_config/config.yml add:

Configuration options:

At the very least enabledCommands needs to be overridden in your own config in order to enable the optimising of images resampled by SilverStripe.

This can be done as follows,

  1. Create a file mysite/_config/optimisedimage.yml
  2. Add the following contents

If you want to add your own commands, you can override availableCommands e.g.

If your binaries are not located at /usr/local/bin/ you can override this by setting binDirectory

If your binaries aren't all located in the same directory you will need to manually enter the command by overriding availableCommands

Commands have certain variables exposed to them when they are built, this is done by sprintf, the variables available are in the following order:

  1. binDirectory
  2. File path to be optimised
  3. optimisingQuality

If when defining a custom command you need to use these arguments in a different order, you will need to use a position specifier, see PHP sprintf

License

Optimised image is licensed under an MIT license


All versions of silverstripe-optimisedimage with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.0
symfony/process Version ~2.3
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 heyday/silverstripe-optimisedimage contains the following files

Loading the files please wait ....