PHPackages                             todstoychev/icr - 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. todstoychev/icr

ActiveLibrary

todstoychev/icr
===============

Image manipulation and upload module

0.3.5(9y ago)2825MITPHPPHP &gt;=5.5.9

Since Nov 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/todstoychev/icr)[ Packagist](https://packagist.org/packages/todstoychev/icr)[ Docs](https://github.com/todstoychev/icr)[ RSS](/packages/todstoychev-icr/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (23)Used By (0)

[![Build Status](https://camo.githubusercontent.com/a2af07e47ce3aafbe76c5a99fb0ed460a0464a0864e00ce03660bdf3cfcc6d2f/68747470733a2f2f7472617669732d63692e6f72672f746f6473746f79636865762f6963722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/todstoychev/icr)

This is an image manipulation module based on the [Imagine](https://github.com/avalanche123/Imagine) module. It is for Laravel 5.\* php framework.

Installation
============

[](#installation)

Use the standard composer way:

```
composer require todstoychev/icr

```

Or add to your composer.json:

```
"require": {
    ...
    "todstoychev/icr": "dev-master",
    ...
    }
```

and run

`composer update`

Configuration
=============

[](#configuration)

In the `'providers'` section of your Laravel `config/app.php` add: `Todstoychev\Icr\ServiceProvider::class,`.

In the `'aliases'` you can add: `'Icr' => \Todstoychev\Icr\Icr::class,`

Run `php artisan vendor:publish --provider="Todstoychev\Icr\ServiceProvider"` to publish the config or you cal use also `php artisan vendor:publish --tag=icr`.

You will need also to set a new setting for the Storage module of Laravel. This can be done in the `config/filesystem.php`. You can create something similar:

```
'local' => [
    'driver' => 'local',
    'root'   => public_path('/uploads/images'),
],
```

Put this one at the `disks` section of the file.

The config file
---------------

[](#the-config-file)

The file can be found in `config/` it is called `icr.php`. The file contains several sections and parameters.

### image\_adapter

[](#image_adapter)

This is setting for the driver library that will be used to process the images. Imagine has support for Gd, Imagick and Gmagick, the available values are gd, imagick or gmagick.

### Contexts

[](#contexts)

Those are the context settings. Each context is presented by array. The default one looks like this:

```
'default' => [
        'small' => [
            'width' => 100,
            'height' => 100,
            'operation' => 'resize',
        ],
        'medium' => [
            'width' => 300,
            'height' => 300,
            'operation' => 'resize',
        ],
        'large' => [
            'width' => 600,
            'height' => 600,
            'operation' => 'resize',
        ],
    ],
```

Each context can define different sizes. The size array has 3 parameters: width, height and operation.

```
'small' => [
            'width' => 32,
            'height' => 32,
            'operation' => 'resize-crop',
        ],
```

Allowed operations are crop, resize, scale, resize-crop.

- crop - crops region from the center of the provided image;
- resize - resize image to given dimensions as keeps the proportions of the image;
- scale - scales the image to given dimensions;
- resize-crop - first resize the image while keeping the original proportions and then crops an region from the image center with the given size.

Methods
=======

[](#methods)

To use the module call its basic class - Icr. The class contain 2 methods. One to upload images, the other to delete. Another way to using it is to instantiate `Todstoychev\Icr\Processor`

Upload image
------------

[](#upload-image)

The Icr::uploadImage() method returns the file name on success. if any errors it returns an exception class instance. You can use something similar in your controller method:

```
$response = Icr::uploadImage($request->file('image'), 'my_context', 'images');

if ($response instanceof \Exception) {
    // Handle the error
} else {
    // Save the image name to database. Example: $myModel->saveImage($response);
}
```

As first argument you should use what is coming as file from the request, second argument is the context. The third argument is your setting name from the `config/filesystem.php`.

Delete image
------------

[](#delete-image)

This can be performed with Icr::deleteImage(). Example:

```
$response = Icr::deleteImage('my_file_name', 'my_context', 'images');

if ($response instanceof \Exception) {
    // Handle the error
} else {
    // Delete the image name from database. Example: $myModel->deleteImage($response);
}
```

Parameters are the same as in the uploadImage() method, except the first one which is the file name of the file that should be deleted.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Every ~14 days

Recently: every ~5 days

Total

21

Last Release

3556d ago

PHP version history (2 changes)v0.1.0-alphaPHP &gt;=5.4

v0.1.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4d5af278828b70e08928a5c1a6b33975cb9709ef0829d4822b5b083887a410f?d=identicon)[todstoychev](/maintainers/todstoychev)

---

Top Contributors

[![todstoychev](https://avatars.githubusercontent.com/u/4498971?v=4)](https://github.com/todstoychev "todstoychev (144 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/todstoychev-icr/health.svg)

```
[![Health](https://phpackages.com/badges/todstoychev-icr/health.svg)](https://phpackages.com/packages/todstoychev-icr)
```

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M186](/packages/spatie-laravel-backup)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M73](/packages/unisharp-laravel-filemanager)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/vapor-cli

The Laravel Vapor CLI

31310.7M8](/packages/laravel-vapor-cli)[illuminate/session

The Illuminate Session package.

9937.4M751](/packages/illuminate-session)

PHPackages © 2026

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