PHPackages                             mafa/imageaspect - 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. mafa/imageaspect

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

mafa/imageaspect
================

ImageAspect - A simple Image Aspect crop coordination generator.

0.1.2(5y ago)031MITPHP

Since Dec 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/afarideh/ImageAspect)[ Packagist](https://packagist.org/packages/mafa/imageaspect)[ RSS](/packages/mafa-imageaspect/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

ImageAspect
===========

[](#imageaspect)

ImageAspect - A simple Image Aspect Ratio crop coordination generator.

Install
=======

[](#install)

Composer

```
composer require mafa/imageaspect
```

Quick Example
=============

[](#quick-example)

```
$imageAspect = new \MAfa\ImageAspect\ImageAspect(800, 440);
$coordinates = $imageAspect->aspect(2, 1)->generateCoordinates();

// Response is a ImageAspectModel object
MAfa\ImageAspect\ImageAspectModel {
  -width: 800
  -height: 400
  -x: 0
  -y: 0
}

// x is integer to crop from left of image
$coordinates->getX();

// y is integer to crop from top of image
$coordinates->getY();

// width is integer to crop to right of image and width of final width in expected aspect ratio
$coordinates->getWidth();

// height is integer to crop to bottom of image and width of final height in expected aspect ratio
$coordinates->getHeight();
```

ImageAspectModel object
-----------------------

[](#imageaspectmodel-object)

MethodValueType**getWidth()**Width of Image in expected Aspect ratiointeger**getHeight()**Height of Image in expected Aspect ratiointeger**getX()**Start area from left of image to cropinteger**getY()**Start area from top of image to cropinteger

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1968d ago

### Community

Maintainers

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

---

Top Contributors

[![afarideh](https://avatars.githubusercontent.com/u/76428460?v=4)](https://github.com/afarideh "afarideh (6 commits)")

---

Tags

aspect-ratioimage-cropperphpphpimageimagecrop

### Embed Badge

![Health badge](/badges/mafa-imageaspect/health.svg)

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

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