PHPackages                             macgyer/yii2-cropit - 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. macgyer/yii2-cropit

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

macgyer/yii2-cropit
===================

Yii2 implementation of cropit

1.0.3(8y ago)21.6kBSD-3-ClausePHPPHP &gt;=5.4.0

Since May 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/MacGyer/yii2-cropit)[ Packagist](https://packagist.org/packages/macgyer/yii2-cropit)[ Docs](http://macgyer.github.io/yii2-cropit)[ RSS](/packages/macgyer-yii2-cropit/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

[![license](https://camo.githubusercontent.com/e636768cae2e2f48fb62a8ee4fc6839fc285a19eddc53547458c64e016e53e47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c4943454e43452d4253442d2d332d2d436c617573652d626c75652e737667)](https://packagist.org/packages/macgyer/yii2-cropit)[![Github Release](https://camo.githubusercontent.com/9959d7f190f4026f06431d94249de1121956be34d9418c84f3e9598507613f3e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d6163677965722f796969322d63726f7069742e737667)](https://packagist.org/packages/macgyer/yii2-cropit)[![Packagist](https://camo.githubusercontent.com/6f0e5af299843df591c0c5110affc24f7e2a314c0db198732777ce8f08361217/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6163677965722f796969322d63726f7069742e737667)](https://packagist.org/packages/macgyer/yii2-cropit)

yii2-cropit
===========

[](#yii2-cropit)

Implementation of Scott Cheng's jQuery plugin [cropit](https://github.com/scottcheng/cropit).

**Currently implemented cropit.js version: 0.5.1**

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

[](#installation)

The preferred way of installation is through Composer. If you don't have Composer you can get it here:

To install the package add the following to the `require` section of your composer.json:

```
"require": {
    "macgyer/yii2-cropit": "*"
},

```

Usage
-----

[](#usage)

This widget can be used in ActiveForm or as standalone input widget and comes with a [Data URI](https://en.wikipedia.org/wiki/Data_URI_scheme)validator (as Composer dependency).

The widget can be profoundly configured to meet your needs. Please see all options and below and refer to the original [cropit documentation](http://scottcheng.github.io/cropit/).

To use the widget in your form, you might do the following:

```
// add the field to your Model class, either ActiveRecord property or class member:

public $cropped_image_data;

// rules
public function rules()
{
  return [
      // more rules
      ['cropped_image_data', \macgyer\yii2dataurivalidator\DataUriValidator::className()],
  ];
}

```

```
// in your View, define the field and widget:

```

Road map
--------

[](#road-map)

- create style assets

Change log
----------

[](#change-log)

### 1.0.3 - 2017-07-29

[](#103---2017-07-29)

- fixed illegal offset type error when used in PHP 5.6 environment ([\#3](https://github.com/MacGyer/yii2-cropit/issues/3))
- cropit.js version set to 0.5.1

### 1.0.2 - 2016-06-02

[](#102---2016-06-02)

- changed handling of custom JS handlers ([\#2](https://github.com/MacGyer/yii2-cropit/issues/2))
- fixed image export options bug ([\#1](https://github.com/MacGyer/yii2-cropit/issues/1))

### 1.0.1 - 2016-05-30

[](#101---2016-05-30)

- moved [DataUriValidator into separate repo](https://github.com/MacGyer/yii2-data-uri-validator)

### 1.0.0 - 2016-05-29

[](#100---2016-05-29)

- initial release

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

4

Last Release

3258d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78f83100a0024086e9dcecb006456faedf561f296fbc0b6a86b6eb1f052e46c0?d=identicon)[macgyer](/maintainers/macgyer)

---

Top Contributors

[![MacGyer](https://avatars.githubusercontent.com/u/2939625?v=4)](https://github.com/MacGyer "MacGyer (3 commits)")

---

Tags

jqueryyii2image-cropImage uploadcropit

### Embed Badge

![Health badge](/badges/macgyer-yii2-cropit/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[raoul2000/yii2-jcrop-widget

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

10262.8k2](/packages/raoul2000-yii2-jcrop-widget)[trntv/yii2-glide

Yii2 Glide Extension

41273.6k9](/packages/trntv-yii2-glide)[newerton/yii2-jcrop

Jcrop is the quick and easy way to add image cropping functionality to your web application.

2163.5k](/packages/newerton-yii2-jcrop)

PHPackages © 2026

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