Download the PHP package webiny/image without Composer

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

Image Component

The Image component provides basic functions for manipulating images. Component also fixes the incorrect rotation on pictures taken by a smartphone like iPhone or Android.

Install the component

The best way to install the component is using Composer.

For additional versions of the package, visit the Packagist page.

Usage

This component is deeply coupled with the Storage component, so it's advised that you get yourself familiar with that component first, if you already haven't.

Under basic functions it's meant that you can do these manipulations on any image:

But before you can do any of the manipulations, you must first load an image. You can load an image from several different sources by calling appropriate methods on ImageLoader class:

Each of these methods returns an instance of ImageInterface. Using ImageInterface you can perform the defined manipulations on the loaded image.

Once you are done manipulating the image you can either save it by calling the save method, or you can output the image by calling the show method.

Here is a usage example:

Using ImageTrait

An easier way of loading the image and creating instances of ImageInterface is using the ImageTrait. Here is an example of loading the image from the \Webiny\Component\Storage\File\File object:

Here is another example where we load the image by file storage key and storage driver:

So as you can see, you can load and create ImageInterface instances either by passing directly the File object, or by passing the file key together with the name of the storage service.

Bridge

The default bridge for image library uses Imagine library (https://github.com/avalanche123/Imagine) by Bulat Shakirzyanov which perform all the image manipulations.

If you wish to expand or change the current bridged library you need to create two classes:

After that just change the Bridge in the configuration and the framework will use your bridge instead the default one.

Configuration

The Image component requires very little configuration. Here is an example:

The Library parameter defines which image library will be used. Supported libraries by Imagine library are:

The Quality parameter defines at which quality to save the image. The default quality is 90 (max is 100).

To register the config with the component, just call Image::setConfig($pathToYamlConfig).

Resources

To run unit tests, you need to use the following command:

$ cd path/to/Webiny/Component/Image/
$ composer.phar install
$ phpunit

All versions of image with dependencies

PHP Build Version
Package Version
Requires php Version ^7
webiny/config Version ~1.6
webiny/std-lib Version ~1.6
webiny/storage Version ~1.6
webiny/event-manager Version ~1.6
imagine/imagine Version 0.6.*
ext-gd Version *
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 webiny/image contains the following files

Loading the files please wait ....