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

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

pribolshoy/yii2-cropper
=======================

Yii-Framework widget for uploading and cropping images

032PHP

Since Sep 17Pushed 2y agoCompare

[ Source](https://github.com/Pribolshoy/yii2-cropper)[ Packagist](https://packagist.org/packages/pribolshoy/yii2-cropper)[ RSS](/packages/pribolshoy-yii2-cropper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Cropper
=======

[](#cropper)

Yii-Framework extension for uploading and cropping images

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist budyaga/yii2-cropper "*"

```

or add

```
"budyaga/yii2-cropper": "*"

```

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

Usage
-----

[](#usage)

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

```
use budyaga\cropper\Widget;

```

```

```

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 imageYesnoPhotoImageThe picture, which is used when a photo is not loaded.You can see it on screenshots in this instructionsNomaxSizeThe maximum file size (kb).2097152NocropAreaWidthWidth box for preview300NocropAreaHeightHeight box for preview300NoaspectRatioFix aspect ratio of cropping areanullNoextensionsAllowed file extensions (string).jpeg, jpg, png, gifNoIn UserController:

```
public function actions()
{
    return [
        'uploadPhoto' => [
            'class' => 'budyaga\cropper\actions\UploadAction',
            'url' => 'http://your_domain.com/uploads/user/photo',
            'path' => '@frontend/web/uploads/user/photo',
        ]
    ];
}

```

Action has following parameters:

NameDescriptionDefaultRequiredpathPath for saving image after crippingYesurlURL to which the downloaded images will be available.YesuploadParameterUpload 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)1NoYou can use this widget on frontend and backend. For example: user can change his userpic and administrator can change users userpic.

Operates as follows:
--------------------

[](#operates-as-follows)

User click on new photo area or drag file

[![g4n7fva](https://cloud.githubusercontent.com/assets/7313306/7107319/a09bb4a0-e16a-11e4-9ac5-f57509ba841b.png)](https://cloud.githubusercontent.com/assets/7313306/7107319/a09bb4a0-e16a-11e4-9ac5-f57509ba841b.png)

The picture is loaded by JavaScript FileAPI.

[![yeul3gy](https://cloud.githubusercontent.com/assets/7313306/7107329/02f3eeba-e16b-11e4-9f9d-fb07944a91df.png)](https://cloud.githubusercontent.com/assets/7313306/7107329/02f3eeba-e16b-11e4-9f9d-fb07944a91df.png)

This picture is displayed in the widget and users have the ability to crop it or upload another picture

[![jaungjk](https://cloud.githubusercontent.com/assets/7313306/7107356/8581f3ae-e16b-11e4-8151-d08a4d16f1a0.png)](https://cloud.githubusercontent.com/assets/7313306/7107356/8581f3ae-e16b-11e4-8151-d08a4d16f1a0.png)

When the user clicks "Crop image", a request with file and coordinates is sent to the server. This picture is displayed in the form, and user can save it, or change crop area, or upload another photo.

[![0ejh55q](https://cloud.githubusercontent.com/assets/7313306/7107359/bddeae36-e16b-11e4-889b-484d7dbad8a5.png)](https://cloud.githubusercontent.com/assets/7313306/7107359/bddeae36-e16b-11e4-889b-484d7dbad8a5.png)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 67.2% 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/0e908883bc19c6c5857d3c5cdf9476cbba83176f1f65e43de73cc9cb5ae4d3eb?d=identicon)[Pribolshoy](/maintainers/Pribolshoy)

---

Top Contributors

[![krivochenko](https://avatars.githubusercontent.com/u/7313306?v=4)](https://github.com/krivochenko "krivochenko (45 commits)")[![maxprihodko8](https://avatars.githubusercontent.com/u/22602672?v=4)](https://github.com/maxprihodko8 "maxprihodko8 (4 commits)")[![Pribolshoy](https://avatars.githubusercontent.com/u/18686309?v=4)](https://github.com/Pribolshoy "Pribolshoy (3 commits)")[![linuskohl](https://avatars.githubusercontent.com/u/2761641?v=4)](https://github.com/linuskohl "linuskohl (2 commits)")[![DmitryBay](https://avatars.githubusercontent.com/u/5918164?v=4)](https://github.com/DmitryBay "DmitryBay (2 commits)")[![art009](https://avatars.githubusercontent.com/u/4653709?v=4)](https://github.com/art009 "art009 (2 commits)")[![softark](https://avatars.githubusercontent.com/u/342857?v=4)](https://github.com/softark "softark (2 commits)")[![itsJereMe](https://avatars.githubusercontent.com/u/8949792?v=4)](https://github.com/itsJereMe "itsJereMe (2 commits)")[![xavsio4](https://avatars.githubusercontent.com/u/1721936?v=4)](https://github.com/xavsio4 "xavsio4 (1 commits)")[![carlocaprini](https://avatars.githubusercontent.com/u/7250891?v=4)](https://github.com/carlocaprini "carlocaprini (1 commits)")[![Matvik](https://avatars.githubusercontent.com/u/3477400?v=4)](https://github.com/Matvik "Matvik (1 commits)")[![oonne](https://avatars.githubusercontent.com/u/17686801?v=4)](https://github.com/oonne "oonne (1 commits)")[![uraankhayayaal](https://avatars.githubusercontent.com/u/13504758?v=4)](https://github.com/uraankhayayaal "uraankhayayaal (1 commits)")

### Embed Badge

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

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

###  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)[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)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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