Download the PHP package flaviovs/yii2-imagefilter without Composer

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

Yii2 Imagefilter extension

The Yii2 Imagefilter extension provides a mechanism to automatically transform and generate ("filter") image files. For example, you can define a pipeline called "thumbnail-100", and add a filter to it that transforms an image into a 100px thumbnail. When the pipeline image URL is accessed for the first time, Yii2 Imagefilter will apply all filters configured pipeline, and then save and output the image. On a properly configured web server software (i.e. nginx, Apache, etc.), the next time the image URL is accessed the file is served directly, withou any PHP/Yii2 overhead.

Important: processed images are saved to your @webroot, so your web server should be configured to serve existing files directly. Also, this extension requires enablePrettyUrl to be enabled in your Yii2 URL manager configuration. See https://www.yiiframework.com/doc/guide/2.0/en/runtime-routing#using-pretty-urls for more info.

Usage

  1. Configure the imagefilter component in your Yii2 application. This usually means editing @app\config\web.php and including the following lines:

    Notice that you can have several filters in a single pipeline. Multiple filters are applied in the sequence they are configured.

    See Creating filters below to know about creating image filters.

  2. Add the image filter Action to one of your controllers. For example, you could create a controller that looks like this:

  3. Configure an URL rule pointing to the Imagefilter action you just created in the previous step:

  4. Generate URLs to images using the imagefilter component.

    To generate na URL, call $app->imagefilter->url():

    Call $app->imagefilter->img() to generate a complete <img> tag:

    Note: URL path and options array are used the same way as in [\yii\helpers\Html::img()](https://www.yiiframework.com/doc/api/2.0/yii-helpers-basehtml#img()-detail).

Creating filters

Filters are defined by PHP classes that implements the fv\yii\imagefilter\Filter interface:

The separate Yii2 Imagefilters extension (note: plural) contains some ready-to-use filters for Yii2 Imagefilter.

Pipeline versioning

Each pipeline can have a version (default "0"). The version is used to generate the final, filtered image URL. This allow you to force browsers to load new images on the next requests by just changing a pipeline version. This also allows you to implement very aggressive caching for image files (i.e. you can instructing your web server to generate HTTP caching headers that expire image files far in the future).

Example:

Since no version was specified, this pipeline is assigned version "0" (you can check this by looking at URLs of filtered images, which should be like /assets/img/standard-watermark/0/img/my-image.png -- note the "0" as the fourth element in the path).

Now suppose that you changed your watermark font size from 10 to 12 pixels. To force browsers to load new images, just change the pipeline version:

Notes:

  1. The extension will never delete older versions from your @webroot. You should do it manually.

  2. Another approach to force browsers get new filtered images is to simply remove the directory corresponding to the current version. This will force Yii2 Imagefilter to regenerate new images.

Support

Visit http://github.org/flaviovs/yii2-imagefilter


All versions of yii2-imagefilter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
yiisoft/yii2 Version ^2.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 flaviovs/yii2-imagefilter contains the following files

Loading the files please wait ....