Download the PHP package voskobovich/yii2-dynamic-image without Composer

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

Yii2 Dynamic Image

A toolkit to resize and crop images on the fly as specified in a GET request.

License Latest Stable Version Latest Unstable Version Total Downloads

Support

GutHub issues.

See example

Directory structure

This toolkit requires your images to be organized in a specific manner.

A certain directory is the root:

uploads/images

Images that belong to certain entities (articles, users, etc.) are located in directories that correspond to those entities and their ids:

uploads/images/article/123
uploads/images/user/456

Every image should have an alphanumeric name (usually some kind of hash) and a proper extension:

uploads/images/article/123/acbd18db4cc2f85cedef654fccc4a4d8.jpg
uploads/images/user/456/37b51d194a7513e45b56f6524f2d51f2.png

Web Package

Getting images

Suppose the original image is available at this URL:

and you need it resized to 300x400 pixels. Simply add the desired dimensions to the name of the image as shown below:

The image will be resized proportionately and excess cropped. Not bad, right?

But what if only one of the dimensions is significant, and the other one is not? In this case, you need to set the non-significant dimension to zero:

or

Placeholder

The system can be configured to work with placeholders to serve when the image is not available. Placeholder file is usually named placeholder.png. There are two kinds of placeholder - general and entity-specific. General placeholder is placed into the root directory, entity-specific placeholder is placed into the entity directory:

http://example.com/uploads/images/placeholder.png
http://example.com/uploads/images/article/placeholder.png

With this configuration, article images have their own specific placeholder, while user images fall back to the general placeholder. Requesting a non-existent user image will return the general placeholder (http://domain.com/uploads/images/placeholder.png), while requesting a non-existent article image will return the entity-specific article placeholder (http://domain.com/uploads/images/article/placeholder.png).

Uploading images

To upload a image you need to send a multipart/form-data POST request:

The response will contain

API Package

Getting images

After configuration the answer API you get 4 new attribute.

Now on the client you can do so

Uploading images

To upload a image you need to send a multipart/form-data POST request:

The response will contain

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Usage

Web Package

Use the package for voskobovich\image\dynamic\web.

Create and configure your controller.

API Package

Use the package for voskobovich\image\dynamic\rest.

Configure your controller as described above.

Configure ImagePathMap component in your config file.

Web server configuration

Nginx
Apache

All versions of yii2-dynamic-image with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
yiisoft/yii2 Version ~2.0.0
yiisoft/yii2-imagine Version ~2.0.0
voskobovich/yii2-base-toolkit Version ~1.0.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 voskobovich/yii2-dynamic-image contains the following files

Loading the files please wait ....