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

ActiveLibrary

renatomontanari/cropper
=======================

Modern PHP image cropper with cache and WebP support

v2.0.0(4d ago)01MITPHPPHP &gt;=8.3

Since Mar 17Pushed 4d agoCompare

[ Source](https://github.com/informaticalivreoficial/cropper)[ Packagist](https://packagist.org/packages/renatomontanari/cropper)[ Docs](https://informaticalivre.com.br)[ RSS](/packages/renatomontanari-cropper/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Cropper by Renato Montanari
===========================

[](#cropper-by-renato-montanari)

[![Maintainer](https://camo.githubusercontent.com/fedc7c341b8d07cead1758fe6815719d14310ca6898c529f4260ff8b87113066/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65722d4072656e61746f6d6f6e74616e6172692d626c75652e7376673f7374796c653d666c61742d737175617265)](https://informaticalivre.com.br)[![Source Code](https://camo.githubusercontent.com/49fec292c5f98eb1a48474ca244cde0f74a23987173c2cdd55ab5f098283508d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d72656e61746f6d6f6e74616e6172692f63726f707065722d626c75652e737667)](https://github.com/renatomontanari/cropper)[![PHP from Packagist](https://camo.githubusercontent.com/7da98ccdfc491939706a6760318d740ddfa582f941cd857a45fd5d18aa19b994/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f72656e61746f6d6f6e74616e6172692f63726f707065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/renatomontanari/cropper)[![Latest Version](https://camo.githubusercontent.com/a19cfa417a4a5bd05e4e2c4ede5e823904b1724167036fba0586ca25b55d5a13/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f72656e61746f6d6f6e74616e6172692f63726f707065722e7376673f7374796c653d666c61742d737175617265)](https://github.com/informaticalivreoficial/cropper/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/62383fcaa11fbc4245dd32ae6377c7b20037fdb46cc39b57e26566d1a3663350/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72656e61746f6d6f6e74616e6172692f63726f707065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/renatomontanari/cropper)

###### Smart Cropper is a modern PHP image cropping and thumbnail generation library with built-in caching and WebP support.

[](#smart-cropper-is-a-modern-php-image-cropping-and-thumbnail-generation-library-with-built-in-caching-and-webp-support)

Cropper é um componente que simplifica a criação de miniaturas de imagens JPG, PNG e WebP com um motor de cache inteligente. O Cropper cria versões de suas imagens para cada dimensão necessária na aplicação com zero de complexidade.

---

### Highlights

[](#highlights)

- Simple Thumbnail Creator (Simples criador de miniaturas)
- Cache optimization per dimension (Otimização em cache por dimensão)
- WebP output by default (Saída em WebP por padrão)
- Media Control by Filename (Controle de mídias por nome do arquivo)
- Cache cleanup by filename and total (Limpeza de cache por nome de arquivo e total)
- Composer ready and PSR-2 compliant (Pronto para o composer e compatível com PSR-2)

---

Requisitos
----------

[](#requisitos)

- PHP &gt;= 8.0
- Extensão GD habilitada
- Composer

---

Instalação
----------

[](#instalação)

Cropper está disponível via Composer:

```
composer require renatomontanari/cropper
```

Ou adicione manualmente no `composer.json`:

```
"require": {
    "renatomontanari/cropper": "2.0.*"
}
```

---

Documentação
------------

[](#documentação)

São apenas dois métodos para fazer todo o trabalho. Você só precisa chamar o **`make`** para criar ou usar miniaturas de qualquer tamanho, ou o **`flush`** para liberar o cache de um arquivo ou da pasta toda.

#### Criar miniaturas

[](#criar-miniaturas)

```
