PHPackages                             crazysnowflake/yii2-image-cropper - 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. crazysnowflake/yii2-image-cropper

ActiveYii2-extension[Image &amp; Media](/categories/media)

crazysnowflake/yii2-image-cropper
=================================

A Javascript Image Cropper

1.0.1(5y ago)013MITPHP

Since May 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/crazysnowflake/yii2-image-cropper)[ Packagist](https://packagist.org/packages/crazysnowflake/yii2-image-cropper)[ Docs](https://github.com/crazysnowflake/yii2-image-cropper)[ RSS](/packages/crazysnowflake-yii2-image-cropper/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

yii2-image-cropper
==================

[](#yii2-image-cropper)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/crazysnowflake/yii2-image-cropper/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

To install, either run

```
$ php composer.phar require crazysnowflake/yii2-image-cropper "^1.0@dev"

```

or add

```
"crazysnowflake/yii2-image-cropper": "^1.0@dev"

```

to the `require` section of your `composer.json` file.

Release Changes
---------------

[](#release-changes)

> NOTE: Refer the [CHANGE LOG](https://github.com/crazysnowflake/yii2-image-cropper/blob/master/CHANGE.md) for details on changes to various releases.

Usage
-----

[](#usage)

```
use crazysnowflake\imagecropper\ImageCropperWidget;

$form = ActiveForm::begin( [
        'id'                   => 'edit-profile',
        'options'              => [ 'enctype' => 'multipart/form-data' ],
        'fieldConfig'          => [
            'inputOptions' => [ 'class' => 'form-control form-control-lg' ]
        ],
    ] );

echo $form->field( $model, 'virtualImage' )
          ->widget( ImageCropperWidget::classname(), [
                'options'       => [
                    'id'       => 'user-avatar',
                    'accept'   => 'image/*',
                    'multiple' => false,
                ],
                'templateImage' => $model->avatar ? \yii\helpers\Html::img( $model->avatar ) : null,
            ] )->label( 'Profile Image' )->hint( 'We recommend a square image for best results. The ideal size would be 200px wide by 200px high.', [ 'class' => 'hint-block text-muted' ] ); ?>

ActiveForm::end();
```

\#####Your controller function:

```
use crazysnowflake\imagecropper\ImageCropper;

protected function saveImageProfile() {
    $this->virtualImageProfile = UploadedFile::getInstance($this, 'virtualImageProfile');

    if ($this->virtualImageProfile && $this->virtualImageProfile->type === 'image/jpeg') {
        $data = Yii::$app->request->post( 'cropdata' );
        if( $data && isset($data['virtualImageProfile']) && $data['virtualImageProfile'] ){
            ImageCropper::cropImageSection($this->virtualImageProfile->tempName, $this->virtualImageProfile->tempName, $data['virtualImageProfile']);
        }
        $filename = uniqid() . '.' . $this->virtualImageProfile->extension;
        $this->virtualImageProfile->saveAs(Yii::getAlias('@app') . "/web/uploads/users/" . $filename);

    }
}
```

License
-------

[](#license)

**yii2-image-cropper** is released under the MIT License. See the bundled `LICENSE.md` for details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~1 days

Total

2

Last Release

2181d ago

### Community

Maintainers

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

---

Top Contributors

[![olenkadark](https://avatars.githubusercontent.com/u/5089167?v=4)](https://github.com/olenkadark "olenkadark (7 commits)")

---

Tags

imagejquerybootstrapavatarcroppercroppieprofile imagecrop image

### Embed Badge

![Health badge](/badges/crazysnowflake-yii2-image-cropper/health.svg)

```
[![Health](https://phpackages.com/badges/crazysnowflake-yii2-image-cropper/health.svg)](https://phpackages.com/packages/crazysnowflake-yii2-image-cropper)
```

###  Alternatives

[lasserafn/php-initial-avatar-generator

A package to generate avatars with initials for PHP

4374.2M13](/packages/lasserafn-php-initial-avatar-generator)[yzalis/identicon

Generate unique identicon avatars from any string

5901.1M21](/packages/yzalis-identicon)[multiavatar/multiavatar-php

Multicultural Avatar Generator

653150.0k4](/packages/multiavatar-multiavatar-php)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16625.8k2](/packages/gravatarphp-gravatar)[laravel-admin-ext/cropper

Integrate Cropper into laravel-admin

7233.5k](/packages/laravel-admin-ext-cropper)[raoul2000/yii2-jcrop-widget

This extension is a wrapper for the jQuery Image Cropping Plugin (jcrop)

10248.3k2](/packages/raoul2000-yii2-jcrop-widget)

PHPackages © 2026

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