PHPackages                             mymedia/slir-fork - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mymedia/slir-fork

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mymedia/slir-fork
=================

SLIR hard fork

01.9kPHP

Since Aug 10Pushed 7y ago4 watchersCompare

[ Source](https://github.com/MyMedia/slir-fork)[ Packagist](https://packagist.org/packages/mymedia/slir-fork)[ RSS](/packages/mymedia-slir-fork/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#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.

For questions or support, please [visit the SLIR Google Group](https://groups.google.com/forum/?fromgroups#!forum/smart-lencioni-image-resizer). If you have found a bug, please [use the issue tracker](https://github.com/lencioni/SLIR/issues).

New features
------------

[](#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](https://pngquant.org/) integration for PNG images - huge optimization
- [Tinypng](https://tinypng.com/) service integration
- Downloading and resizing remote images

Requirements
------------

[](#requirements)

- [PHP](http://php.net) 5.1.2+
- [GD Graphics Library](http://php.net/manual/en/book.image.php) -- must be a version that supports `imageconvolution()`, such as the bundled version

### Recommended

[](#recommended)

- [mod\_rewrite](http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html)

Setting up
----------

[](#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/`.

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

Using
-----

[](#using)

To use SLIR, place an `` 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. ``). 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`  Separate multiple parameters with a hyphen: `/slir/w100-h100-c1x1/path/to/image.jpg`

### Examples

[](#examples)

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

[](#resizing-an-image-to-a-max-width-of-100-pixels-and-a-max-height-of-100-pixels)

```

```

#### Resizing and cropping an image into a square

[](#resizing-and-cropping-an-image-into-a-square)

```

```

#### Resizing and cropping an image to exact dimensions

[](#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:

```

```

Or, more concisely:

```

```

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)

[](#resizing-a-jpeg-without-interlacing-for-use-in-flash)

```

```

#### Matting a PNG with #990000

[](#matting-a-png-with-990000)

```

```

#### Without mod\_rewrite (not recommended)

[](#without-mod_rewrite-not-recommended)

```

```

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

[](#special-characters-eg--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.

```

```

Supporting SLIR
---------------

[](#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.

- [Dwolla](https://www.dwolla.com/hub/lencioni)
- [Flattr](http://flattr.com/thing/178729/Smart-Lencioni-Image-Resizer-SLIR)

---

For more documentation, open `core/slir.class.php` in your favorite text editor.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5462781?v=4)[Denis Voytyuk](/maintainers/denisvmedia)[@denisvmedia](https://github.com/denisvmedia)

---

Top Contributors

[![denisvmedia](https://avatars.githubusercontent.com/u/5462781?v=4)](https://github.com/denisvmedia "denisvmedia (1 commits)")

### Embed Badge

![Health badge](/badges/mymedia-slir-fork/health.svg)

```
[![Health](https://phpackages.com/badges/mymedia-slir-fork/health.svg)](https://phpackages.com/packages/mymedia-slir-fork)
```

###  Alternatives

[simonhamp/laravel-nova-csv-import

A fully-fledged CSV import tool for Laravel Nova.

167469.9k](/packages/simonhamp-laravel-nova-csv-import)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
