2017 © Pedro Peláez
 

library slir-fork

SLIR hard fork

image

mymedia/slir-fork

SLIR hard fork

  • Thursday, July 19, 2018
  • by denisvmedia
  • Repository
  • 4 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SLIR (Smart Lencioni Image Resizer) forked version with some new usefull features

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., (*1)

For questions or support, please visit the SLIR Google Group. If you have found a bug, please use the issue tracker., (*2)

New features

  • Real path cache, resized images are saving to /slir/w-h-c*/path/to/file.ext, so web server can serve it directly
  • Pngquant integration for PNG images - huge optimization
  • Tinypng service integration
  • Downloading and resizing remote images

Requirements

  • PHP 5.1.2+
  • GD Graphics Library -- must be a version that supports imageconvolution(), such as the bundled version

Setting up

Download and unpack to a directory in your web root. I recommend putting SLIR in /slir/ for ease of use. For example, if your website is http://yourdomain.com, then SLIR would be at http://yourdomain.com/slir/., (*3)

After you have SLIR downloaded, visit http://yourdomain.com/slir/install/ in your favorite web browser., (*4)

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:, (*5)

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

Separate multiple parameters with a hyphen: /slir/w100-h100-c1x1/path/to/image.jpg, (*6)

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:, (*7)

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

Or, more concisely:, (*8)

<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., (*9)

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

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., (*10)

<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., (*11)


For more documentation, open core/slir.class.php in your favorite text editor., (*12)

The Versions

19/07 2018

dev-master

9999999-dev

SLIR hard fork

  Sources   Download

GPL-3.0-only

The Development Requires