PHPackages                             stormwild/image-resizer - 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. stormwild/image-resizer

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

stormwild/image-resizer
=======================

PHP class to resize images using GD

1.0.0(11y ago)05MITPHPPHP &gt;=5.3.0

Since Jan 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/stormwild/ImageResizer)[ Packagist](https://packagist.org/packages/stormwild/image-resizer)[ Docs](https://github.com/stormwild/ImageResizer)[ RSS](/packages/stormwild-image-resizer/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

ImageResizer
============

[](#imageresizer)

PHP class to resize images using GD

History
-------

[](#history)

Although, I used a version of this class in a recent project, this is really just an exercise for me to create a simple PHP class library shared through Composer and Packagist.

Setup
-----

[](#setup)

This package is available through Packagist with the vendor and package identifier the same as this repo.

If using [Composer](https://getcomposer.org/), in your `composer.json` file add:

```
{
    "require": {
        "stormwild/image-resizer": "1.0.0"
    }
}
```

Otherwise:

```
include '/path/to/ImageResizer.php';
```

Because this class uses namespacing, when instantiating the object, you need to either use the fully qualified namespace:

```
$resized = \Stormwild\ImageResizer::resizer($path, $width, $height);
```

Or alias it:

```
use \Stormwild\ImageResizer;

$resized = ImageResizer::resizer($path, $width, $height);
```

Usage
-----

[](#usage)

```
    // possibly in controller action
    // check if image uploaded successfully
    // get path to uploaded image

    $path = "path/to/uploaded/file.ext"; // real path to file on server
    $width = 1050;
    $height = 700;

    $resized = ImageResizer::resize($path, $width, $height);

    if($resized) {
        // upload to cloud storage
        // get url from cloud
        // save model with reference to image url
    }
```

The function resizes and replaces(updates) the uploaded file to the specified dimensions.

References
----------

[](#references)

Credits to the many code samples on image resizing using GD on the web. In particular, I referenced the following:

-
-
-

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

4195d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75312f4b02d8d8e1a5d9dc62bb52b91ba4a6a2fc4c3b8d629e42041e45cbd8b3?d=identicon)[stormwild](/maintainers/stormwild)

---

Top Contributors

[![stormwild](https://avatars.githubusercontent.com/u/657249?v=4)](https://github.com/stormwild "stormwild (9 commits)")

---

Tags

phpimageresizescale

### Embed Badge

![Health badge](/badges/stormwild-image-resizer/health.svg)

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

###  Alternatives

[gumlet/php-image-resize

PHP class to re-size and scale images

1.2k6.0M65](/packages/gumlet-php-image-resize)[stefangabos/zebra_image

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

138118.5k7](/packages/stefangabos-zebra-image)

PHPackages © 2026

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