PHPackages                             anytizer/cropnail.php - 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. anytizer/cropnail.php

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

anytizer/cropnail.php
=====================

Cropnail - Ratio maintained thumbnail for any dimensions

027PHP

Since Oct 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/anytizer/cropnail.php)[ Packagist](https://packagist.org/packages/anytizer/cropnail.php)[ RSS](/packages/anytizer-cropnailphp/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

cropnail.php
============

[](#cropnailphp)

Image thumbnailer that maintains aspect ratio in target image.

- Features cropping an image into any image size
- Tries to include best-fit portion
- Trims off vertical or horizontal sides if target ratio was different
- Source image can be of any size
- Target image can be of any size

Usage
-----

[](#usage)

Detailed usages are at: [PHP Unit Tests](phpunit/tests/ResizingTest.php) as runner example.

```
use anytizer\images\cropnail;

$x = 200;
$y = 150;

$cropnail = new cropnail($x, $y);
$cropnail->resize($src_file, $target_file);

```

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

[](#installation)

```
composer require anytizer/cropnail.php:dev-master

```

Samples
-------

[](#samples)

### Original Image

[](#original-image)

[![Original Image](images/photo.jpg)](images/photo.jpg)

### cropnail-ed Images

[](#cropnail-ed-images)

ImagesImages[![Screenshot](resized/photo-100x100.jpg)](resized/photo-100x100.jpg)[![Screenshot](resized/photo-200x400.jpg)](resized/photo-200x400.jpg)*100 x 100**200 x 400*[![Screenshot](resized/photo-100x200.jpg)](resized/photo-100x200.jpg)[![Screenshot](resized/photo-400x100.jpg)](resized/photo-400x100.jpg)*100 x 200**400 x 100*[![Screenshot](resized/photo-100x400.jpg)](resized/photo-100x400.jpg)[![Screenshot](resized/photo-400x200.jpg)](resized/photo-400x200.jpg)*100 x 400**400 x 200*[![Screenshot](resized/photo-200x100.jpg)](resized/photo-200x100.jpg)[![Screenshot](resized/photo-400x400.jpg)](resized/photo-400x400.jpg)*200 x 100**400 x 400*

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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://www.gravatar.com/avatar/1dca2df51e8501678e571f7c3b1c95d66577ea94f95e7005cdfa456fb900106f?d=identicon)[anytizer](/maintainers/anytizer)

---

Top Contributors

[![anytizer](https://avatars.githubusercontent.com/u/5563341?v=4)](https://github.com/anytizer "anytizer (2 commits)")

---

Tags

cropnailgdimageresize-imagesthumbnails

### Embed Badge

![Health badge](/badges/anytizer-cropnailphp/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495225.1k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

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