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 2w ago

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 1% 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://avatars.githubusercontent.com/u/5563341?v=4)[Bimal Poudel](/maintainers/anytizer)[@anytizer](https://github.com/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

[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)
