PHPackages                             todsto/image-crop-resizer - 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. todsto/image-crop-resizer

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

todsto/image-crop-resizer
=========================

Image manipulation bundle for Laravel 4

11171PHP

Since Dec 21Pushed 11y ago1 watchersCompare

[ Source](https://github.com/todstoychev/ImageCropResizer)[ Packagist](https://packagist.org/packages/todsto/image-crop-resizer)[ RSS](/packages/todsto-image-crop-resizer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#installation)

You can install this package in the standart way. Add:

```
"todsto/image-crop-resizer": "dev-master"

```

to your `composer.json`. Run `composer update`Publish the configuration

```
php artisan config:publish todsto/image-crop-resizer

```

Open your `app/config/app.php` and add `'Todsto\ImageCropResizer\ImageCropResizerServiceProvider', ` to the providers array. Then add `'ICR' => 'Todsto\ImageCropResizer\ImageCropResizer'` to the aliases array. This will register 'ICR' as alias for the base bundle class.

Basic usage
===========

[](#basic-usage)

The bundle stores the images in the `public/uploads/context/size` folder.

To set the your own contexts use the `app/config/packages/todsto/image-crop-resizer/contexts.php`. The file looks like this

```
return [
    'default' => [
        'small' => [
            'width' => 100,
            'height' => 100,
            'action' => 'crop-resize'
        ],
        'medium' => [
            'width' => 200,
            'height' => 200,
            'action' => 'crop-resize'
        ],
        'large' => [
            'width' => 300,
            'height' => 300,
            'action' => 'crop-resize'
        ]
    ]
];

```

"default" is the default image context. Context has different sizes which has width, height and action. The action defines the way that the image will be processed. "crop" crops a region with the provided measures from the middle of the image. "resize" resize the image to given measures. "crop-resize" crops a region from the image, but first resize it, so the image will be cropped with no deformations and with minimal losses.

To use the bundle just call in you controller the process method of the ImageCropResizer class. As you have an alias, your code might look like this:

```
    class TestController extends Controller {

        public function getTest() {
            return View::make('test');
        }

        public function postTest() {
            $image_name = ICR::process(Input::file('image'), 'default');

            // Some database actions here

            return Redirect::back()->with('message', 'Success');
        }

    }

```

In the template:

```
    @if(Session::has('message'))
    {{ Session::get('message') }}
    @endif

    {{ Form::open(['url' => 'test/test', 'method' => 'POST', 'enctype' => 'multipart/form-data']) }}
    {{ Form::token() }}

    {{ Form::file('image') }}

    {{ Form::submit('Submit') }}

    {{ Form::close() }}

```

The process method takes as first argument the file object from the input field. The second argument is the context. The process method returns the generated unique image name.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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://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 (17 commits)")

### Embed Badge

![Health badge](/badges/todsto-image-crop-resizer/health.svg)

```
[![Health](https://phpackages.com/badges/todsto-image-crop-resizer/health.svg)](https://phpackages.com/packages/todsto-image-crop-resizer)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

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