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

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

stew/image-cropper
==================

The ImageCropper is designed to be used in web applications for image handling. It provides functionalities for cropping images and converting them to the WebP format.

v1.0.9(2y ago)016MITJavaScript

Since Oct 19Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (11)Used By (0)

Require
-------

[](#require)

- Bootstrap &gt;= 4.0.0
- Jquery &gt;= 3.0.0

Introduction
------------

[](#introduction)

The `ImageCropper` is a utility for cropping and manipulating images in a web application. It provides methods for handling image uploads, cropping, and generating base64 encoded image data.

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

[](#installation)

```
composer require stew/image-cropper
php artisan vendor:publish --provider="Stew\ImageCropper\Providers\ImageCropperServiceProvider" --force

```

HTML Structure
--------------

[](#html-structure)

- To use the ImageCropper class, make sure you have the following HTML structure in your document:

```

@include('view-crop::include._modal-crop-bs4')
@include('view-crop::include._modal-crop-bs5')

```

Usage
-----

[](#usage)

- To use the ImageCropper class, initialize it with a configuration object:

```
const imageCropper = new ImageCropper();

```

#### Default Configuration Options

[](#default-configuration-options)

- `dragTitle` (optional, string): The text to display as the drag-and-drop area title. (default: 'drag &amp; drop to upload').
- `formSelector` (optional, string): The selector for the form to attach hidden input fields. (default: 'form)
- `isThumbnail` (optional, boolean): Specifies whether to generate a thumbnail image. (default: `false`).
- `isOriginalName` (optional, boolean): Specifies whether to include the original image name. (default: `true`).
- `thumbnailSize` (optional, object): Defines the dimensions of the thumbnail image as an object with `width` and `height` properties. (default: { width: 160, height: 160 }).

You can configure the `ImageCropper` by providing these parameters in the initialization object. For example:

```
const config = {
    dragTitle: 'Click or drag to upload an image',
    formSelector: '#upload-form',
    isThumbnail: true,
    isOriginalName: false,
    thumbnailSize: { width: 120, height: 120 },
};
```

- If you wish to add image uploading functionality to your Laravel project, you can utilize the [Image Uploader](https://github.com/ninhnk/image-uploader) package.

```
composer require stew/image-uploader

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

10

Last Release

936d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3889d685b1dcca01732f18f99dfdb5eef764bd1e0a2d4114abd854fae2d6cd6?d=identicon)[ninhnk](/maintainers/ninhnk)

---

Tags

phpimagecropping

### Embed Badge

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

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

###  Alternatives

[stefangabos/zebra_image

A single-file, lightweight PHP library designed for efficient image manipulation featuring methods for modifying images and applying filters

141110.4k6](/packages/stefangabos-zebra-image)[dantsu/php-image-editor

PHP library to easily edit image with GD extension.

34152.1k2](/packages/dantsu-php-image-editor)[lciolecki/php-image-optimizer

PHP image file optimizer (uses https://github.com/bensquire/php-image-optim)

347.4k](/packages/lciolecki-php-image-optimizer)

PHPackages © 2026

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