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

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

spiral/cropper
==============

Image Cropper Widget

v0.4.21(10y ago)2480[1 issues](https://github.com/spiral-modules/cropper/issues)MITJavaScript

Since Jan 20Pushed 10y ago2 watchersCompare

[ Source](https://github.com/spiral-modules/cropper)[ Packagist](https://packagist.org/packages/spiral/cropper)[ RSS](/packages/spiral-cropper/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (24)Used By (0)

Image Cropper Widget
====================

[](#image-cropper-widget)

Module provides ability to crop user image on client side and send to backend as file stream over ajax call.

Usage Example
-------------

[](#usage-example)

At frontend (dark template required), simply add virtual tag to your form:

```

...

```

The code above will be transformed into html and will add required javascript. Result html:

```

    Image Cropper

    Choose a file...

```

Backend:

```
public function uploadAction()
{
    $image = $this->input->file('image');
    //...
}
```

Cropper preview:

[![cropper-preview](https://cloud.githubusercontent.com/assets/12486924/12550729/ad25ddd8-c376-11e5-80c8-bfba0eba4251.jpg)](https://cloud.githubusercontent.com/assets/12486924/12550729/ad25ddd8-c376-11e5-80c8-bfba0eba4251.jpg)

Options
-------

[](#options)

- **wrapper-class** - pass a class to wrapper
- **label** - file-input label
- **label-class** - pass a class to file-input label
- **placeholder** - text to pass to filename-container
- **placeholder-class** - pass a class to filename-container
- **data-format** - how to send data: cropped or full size with coordinates to crop on server *Default: "cropped" Optional: "full"*
- **data-ajax-image** - preloading of image through ajax request *Default: "false" Optional: url of image to preload*
- **data-template** - pass custom html template of cropper
- **data-ajax-address** - request address for submitting (if there is no form) *Default: "false" Optional: request URL*
- **data-ratio** - locked aspect ratio *Default: false*
- **data-filename-selector** - node selector to place filename. If starts with space - global search of node (document) otherwise inside the node (if the node is input, then from parent node)
- **data-info** - what info to show *Default: \[\] Example: data-info="ratio,origSize,croppedSize"*
- **data-preview** - selector of preview element *Default: ""*
- **data-save-btn-text** - save button text *Default: "Save"*
- **data-close-btn-text** - save button text *Default: "Close"*
- **data-custom-btn-class** - pass custom class to btns *Default: ""*
- **data-adjust** - selector of element which triggers crop-modal *Default: ""* If starts with space - global search of node (document) otherwise inside the node (if the node is input, then from parent node)

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

[](#installation)

`composer require spiral/cropper`
`spiral register spiral/cropper`

Update
------

[](#update)

`composer update spiral/cropper`
`spiral publish spiral/cropper`

License
-------

[](#license)

Copyright (c) 2016 Alex Chepura, Yauheni Yasinau and contributors. Released under an [MIT license](https://github.com/spiral-modules/image-cropper/blob/master/LICENSE).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~2 days

Recently: every ~9 days

Total

22

Last Release

3770d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/796136?v=4)[Anton Tsitou](/maintainers/wolfy-j)[@wolfy-j](https://github.com/wolfy-j)

---

Top Contributors

[![iasinov](https://avatars.githubusercontent.com/u/12486924?v=4)](https://github.com/iasinov "iasinov (44 commits)")[![wolfy-j](https://avatars.githubusercontent.com/u/796136?v=4)](https://github.com/wolfy-j "wolfy-j (16 commits)")[![alexichepura](https://avatars.githubusercontent.com/u/5582266?v=4)](https://github.com/alexichepura "alexichepura (13 commits)")[![milky-ashes](https://avatars.githubusercontent.com/u/5727648?v=4)](https://github.com/milky-ashes "milky-ashes (4 commits)")

### Embed Badge

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

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

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

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

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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