Download the PHP package mouf/utils.graphics.image-preset-displayer without Composer

On this page you can find all versions of the php package mouf/utils.graphics.image-preset-displayer. 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 utils.graphics.image-preset-displayer

Graphics image preset displayer

What is this package

This package is used to resize/modify images dynamically on a website. It requires Mouf and Apache as a web-server.

How does it work?

You store the images to be resized/transformed in a directory. For instance: images/original. You would normally access those images like this: http://[myserver]/[myapp]/images/original/test.png. Instead, using this package, you can access http://[myserver]/[myapp]/images/small/test.png.

If the test.png image does not exist in the small directory, it will be automatically resized, and stored in that directory (thanks to a .htaccess file stored in the small directory). Once the image has been generated, the image will be served statically. Therefore, the cost of resizing the image is only paid once, the first time the image is accessed.

This package is very similar to the way the image_cache module works in Drupal.

How to use it

First, start by creating an instance of the StaticImageDisplayer class.

The most important properties are:

Compulsory The initialImageFilter property must be filled with an instance of MoufImageFromFile. For your convenience, you might name this instance sourceImage. The path property of the sourceImage should remain empty. It will be filled on runtime, when an image is requested.

Finally, the most important part. The imageSource property points to an instance of a class implementing the MoufImageInterface. In our case, we are looking to reduce the image size. We will therefore use the MoufImageResize class that resizes an image. Here, we could put any valid transformation provided by the mouf.image package.

Everything is set up. We just need one additional thing. We need to write the .htaccess that will automatically call the StaticImageDisplayer if an image is not found. Hopefully, the StaticImageDisplayer class provides a utility function for this, directly accessible from the Mouf UI.

In your StaticImageDisplayer instance, just click on the "Generate .htaccess" button.

The .htaccess should be generated. You are now ready to test image resizing. Put an image in your basePath folder and try to access it from the savePath URL. You should see the image resized.


All versions of utils.graphics.image-preset-displayer with dependencies

PHP Build Version
Package Version
Requires imagine/imagine Version dev-master
mouf/mouf-installer Version ~2.0
php Version >=5.3.0
mouf/mouf-validators-interface Version ~2.0
mouf/mvc.splash Version ~5.1
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 mouf/utils.graphics.image-preset-displayer contains the following files

Loading the files please wait ....