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

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

razor/cropper
=============

An image cropper service module for Zend Framework 2

026PHP

Since Feb 7Pushed 12y ago1 watchersCompare

[ Source](https://github.com/kaiohken1982/Cropper)[ Packagist](https://packagist.org/packages/razor/cropper)[ RSS](/packages/razor-cropper/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Image Cropper Module
====================

[](#image-cropper-module)

[![Build Status](https://camo.githubusercontent.com/b9fb13bfee3d6af20a938d4ca9fef14a15ce1261a6a5362dd0f875fd235007ca/68747470733a2f2f7472617669732d63692e6f72672f6b61696f686b656e313938322f43726f707065722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/kaiohken1982/Cropper)[![Coverage Status](https://camo.githubusercontent.com/c681228de3ad6431774fd884ffaface39a932dc4eaa890e15ec1a494a77e2f2d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6b61696f686b656e313938322f43726f707065722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/kaiohken1982/Cropper?branch=master)[![Dependency Status](https://camo.githubusercontent.com/1e196b2eee82e92ffe1facb1912ddb76684df1a7d94dfdf95940e53420fe35bf/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3532663536323964656331333735393137343030303038612f62616467652e706e67)](https://www.versioneye.com/user/projects/52f5629dec1375917400008a)[![Latest Stable Version](https://camo.githubusercontent.com/da15a3311bbae736b86de82867bb67e7e649cd9c4e63adda46ba1359b8297e73/68747470733a2f2f706f7365722e707567782e6f72672f72617a6f722f63726f707065722f762f737461626c652e706e67)](https://packagist.org/packages/razor/cropper)[![Total Downloads](https://camo.githubusercontent.com/0d7a3f8583199041a793e588b9406fb574fa7f100b2bfdff527be1dd53eb84ed/68747470733a2f2f706f7365722e707567782e6f72672f72617a6f722f63726f707065722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/razor/cropper)[![Latest Unstable Version](https://camo.githubusercontent.com/3b6a1a783c78712dff62150d21f8dff2ddbc70c7add70873de623fd5c3d848c3/68747470733a2f2f706f7365722e707567782e6f72672f72617a6f722f63726f707065722f762f756e737461626c652e706e67)](https://packagist.org/packages/razor/cropper)[![License](https://camo.githubusercontent.com/ab3d86a1bd5093417a4304537d6d6a5abf3dfa32b9bc4a3ea6ecd8ccaee21f9c/68747470733a2f2f706f7365722e707567782e6f72672f72617a6f722f63726f707065722f6c6963656e73652e706e67)](https://packagist.org/packages/razor/cropper)

An image cropper service module for Zend Framework 2.

### Install with Composer

[](#install-with-composer)

```
{
 "repositories": [
       {
           "type": "vcs",
           "url": "https://github.com/kaiohken1982/Cropper.git"
       }
   ],
   "require": {
       ......,
       "razor/cropper" : "dev-master"
   }
}

```

### How to use

[](#how-to-use)

In a controller

```
		$cropper = $this->getServiceLocator()->get('Cropper');
   	$cropper->open('/path/to/image.jpg');

   	// Type of the cut, on top image (2) or centered (1), default 1
   	// $cropper->setType(1);

   	// this will cut a 200x200 square
   	$cropper->setSize(200, 200);

   	// this will cut a square in the source image, where side equal source image width
   	//$cropper->setSquareMode(true);

   	$cropper->save('/path/to/image_cropped.jpg');

```

### Run unit test

[](#run-unit-test)

Please note you must be in the module root.

```
curl -s http://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit

```

If you have xdebug enabled and you want to see code coverage run the command below, it'll create html files in Watermarker\\test\\data\\coverage

```
./vendor/bin/phpunit --coverage-html data/coverage

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/112772?v=4)[Razorblade](/maintainers/Razorblade)[@razorblade](https://github.com/razorblade)

---

Top Contributors

[![kaiohken1982](https://avatars.githubusercontent.com/u/1187333?v=4)](https://github.com/kaiohken1982 "kaiohken1982 (25 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/razor-cropper/health.svg)](https://phpackages.com/packages/razor-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

16653.6k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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