PHPackages                             n3m3s7s/yajit - 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. [Image &amp; Media](/categories/media)
4. /
5. n3m3s7s/yajit

ActiveLibrary[Image &amp; Media](/categories/media)

n3m3s7s/yajit
=============

Yet Another Just In Time PHP Image Processor

014PHP

Since May 26Pushed 11y ago1 watchersCompare

[ Source](https://github.com/n3m3s7s/yajit)[ Packagist](https://packagist.org/packages/n3m3s7s/yajit)[ RSS](/packages/n3m3s7s-yajit/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Y.A.J.I.T.
==========

[](#yajit)

Yet Another Just In Time PHP Image Manipulation
===============================================

[](#yet-another-just-in-time-php-image-manipulation)

#### by Fabio Politi ()

[](#by-fabio-politi-n3m3s7sgmailcom)

A simple way to manipulate images "just in time" via the URL. Supports caching, recipes, image quality settings and loading of offsite images.

Installation
------------

[](#installation)

Add "n3m3s7s/yajit" as a requirement to composer.json:

```
{
     "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/n3m3s7s/yajit.git"
        }
    ],
    "require": {
        "n3m3s7s/yajit": "1.1.*@dev"
    }
}
```

Then run `composer update` or `composer install`;

**Warning**: I strongly suggest to run the command "composer dump-autoload --optimize" after composer has finished to download and install all the packages;

Now, if You are using Apache, open the *.htaccess* file of your project or create a new one; add this rule to the .htaccess file:

```
RewriteEngine On
### IMAGE RULES
RewriteRule ^i\/(.+)$ yajit.php?param=$1 [B,L,NC]

```

Instead if You are using Nginx, You should add this rule to your Vhost config:

```
# nginx configuration
location /i {
    rewrite ^/i\/(.+)$ /yajit.php?param=$1 break;
}

```

Create a "yajit.php" file under the root folder of your project and fill it with these lines of code ():

```
