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

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

sultonov/yii2-cropper
=====================

Yii2 framework widget for uploading and cropping images

7649↓20%1[1 issues](https://github.com/sultonov/yii2-cropper/issues)JavaScript

Since Feb 1Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Cropper
============

[](#yii2-cropper)

Yii-Framework extension for uploading and cropping images based on [CropperJs](https://fengyuanchen.github.io/cropperjs/).

Readme file in uzbek language: [README\_UZ.MD](README_UZ.md)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require sultonov/yii2-cropper "dev-master"

```

or add

```
"sultonov/yii2-cropper": "dev-master"

```

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

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

```
use sultonov\cropper\CropperWidget;

```

```

```

Widget has following properties:

NameDescriptionDefaultRequireduploadParameterUpload parameter namefileNowidthThe final width of the image after cropping200NoheightThe final height of the image after cropping200NolabelHint in box for previewIt depends on application language. You can translate this message on your language and make pull-request.NouploadUrlURL for uploading and cropping imageYesprefixUrlPrefix URL for uploaded imageNonoPhotoImageThe picture, which is used when a photo is not loaded.Extension default no-image fileNomaxSizeThe maximum file size (kb).2097152NoavatarCircle box for selection areafalseNopreviewPreview of selection areafalseNoaspectRatioFix aspect ratio of cropping areanullNoextensionsAllowed file extensions (string).jpeg, jpg, png, gifNofreeFree box for selection areafalseNoIn UserController:

```
use sultonov\cropper\actions\UploadAction;

```

```
public function actions()
{
    return [
        'upload-photo' => [
            'class' => UploadAction::className(),
            'url' => '',
            'path' => 'some-path',
        ]
    ];
}

```

Action has following parameters:

NameDescriptionDefaultRequiredpathPath for saving image after croppingYesurlURL to which the downloaded images will be available.YesuploadParamUpload parameter name. It must match the value of a similar parameter of the widget.fileNomaxSizeThe maximum file size (kb). It must match the value of a similar parameter of the widget.2097152NoextensionsAllowed file extensions (string). It must match the value of a similar parameter of the widget.jpeg, jpg, png, gifNowidthThe final width of the image after cropping. It must match the value of a similar parameter of the widget.200NoheightThe final height of the image after cropping. It must match the value of a similar parameter of the widget.200NojpegQualityQuality of cropped image (JPG)100NopngCompressionLevelQuality of cropped image (PNG)1NoprefixPathPrefix URL for uploaded imageNo

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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/b4cca5b07b3cd0264e6ba347bfe261e3815d49d31b7abf2e7529757609d8507f?d=identicon)[sultonov](/maintainers/sultonov)

---

Top Contributors

[![sultonov](https://avatars.githubusercontent.com/u/12808537?v=4)](https://github.com/sultonov "sultonov (12 commits)")

### Embed Badge

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

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

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

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

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

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