Download the PHP package rezozero/slir without Composer

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

SLIR (Smart Lencioni Image Resizer)

Deprecation notice

SLIR is now deprecated in favor of ambroisemaupate/intervention-request library which is based on the strong image-intervention PHP framework. You should consider migrating to this new library which keeps the same Url guidelines.

SLIR (Smart Lencioni Image Resizer) resizes images, intelligently sharpens, crops based on width:height ratios, color fills transparent GIFs and PNGs, and caches variations for optimal performance.

For questions or support, please use the issue tracker.

Requirements

Setting up, standalone

Setting up as a library in a symfony-like environment

Using

To use SLIR, place an <img\> tag with the src attribute pointing to the path of SLIR (typically "/slir/") followed by the parameters, followed by the path to the source image to resize (e.g. <img src="/slir/w100/path/to/image.jpg"/>). All parameters follow the pattern of a one-letter code and then the parameter value:

Parameter Mearning Example
w Maximum width /slir/w100/path/to/image.jpg
h Maximum height /slir/h100/path/to/image.jpg
c Crop ratio /slir/c1x1/path/to/image.jpg
q Quality /slir/q60/path/to/image.jpg
b Background fill color /slir/bf00/path/to/image.png
p Progressive /slir/p1/path/to/image.jpg
g Grayscale /slir/g1/path/to/image.jpg

Separate multiple parameters with a hyphen: /slir/w100-h100-c1x1/path/to/image.jpg

Examples

Resizing an image to a max width of 100 pixels and a max height of 100 pixels

<img src="/slir/w100-h100/path/to/image.jpg"/>

Resizing and cropping an image into a square

<img src="/slir/w100-h100-c1x1/path/to/image.jpg"/>

Resizing and cropping an image to exact dimensions

To do this, you simply need to make the crop ratio match up with the desired width and height. For example, if you want your image to be exactly 150 pixels wide by 100 pixels high, you could do this:

<img src="/slir/w150-h100-c150x100/path/to/image.jpg"/>

Or, more concisely:

<img src="/slir/w150-h100-c15x10/path/to/image.jpg"/>

However, SLIR will not enlarge images. So, if your source image is smaller than the desired size you will need to use CSS to make it the correct size.

Resizing a JPEG without interlacing (for use in Flash)

<img src="/slir/w100-p0/path/to/image.jpg"/>

Matting a PNG with #990000

<img src="/slir/b900/path/to/image.png"/>

Without mod_rewrite (not recommended)

<img src="/slir/?w=100&amp;h=100&amp;c=1x1&amp;i=/path/to/image.jpg"/>

Changing SLIR request URL

<img src="/assets/w150-h100-c15x10/path/to/image.jpg"/>

You can change SLIR request URL to handle it with your own rewrite engine. Just define SLIRConfig::$urlToSLIR to your relative folder: here /assets.

Special characters (e.g. +) in image filenames

Filenames that include special characters must be URL-encoded (e.g. plus sign, +, should be encoded as %2B) in order for SLIR to recognize them properly. This can be accomplished by passing your filenames through PHP's rawurlencode() function.

<img src="/slir/w100/path/to/image%2Bfile.jpg"/>

Supporting SLIR

If you would like to support SLIR or to show your appreciation for the time spent developing this project, please make a financial contribution.


For more documentation, open core/SLIR.php in your favorite text editor.


All versions of slir with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 rezozero/slir contains the following files

Loading the files please wait ....