PHPackages                             m1n64/imageresizer-sdk - 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. m1n64/imageresizer-sdk

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

m1n64/imageresizer-sdk
======================

ImageResizer SDK for PHP

1.0.2(1y ago)091PHPPHP &gt;=8.1

Since May 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/m1n64/image-resizer-sdk)[ Packagist](https://packagist.org/packages/m1n64/imageresizer-sdk)[ RSS](/packages/m1n64-imageresizer-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (3)Used By (1)

📃 PHP SDK for Image Resizer
===========================

[](#-php-sdk-for-image-resizer)

This is a lightweight PHP SDK for interacting with the [Image Resizer Service](https://github.com/m1n64/image-resizing-shared-service). It provides a simple, typed API for uploading and retrieving images via the REST interface.

---

✨ Features
----------

[](#-features)

- Upload images via file, binary, or blob
- Retrieve image metadata and links
- Strict types using DTOs and Enums
- Guzzle-based HTTP client
- Supports optional API key authentication
- Fully unit-tested

> If you're looking for **Laravel ImageResizer SDK** - you may to user this ****

---

⚙️ Installation
---------------

[](#️-installation)

```
composer require m1n64/imageresizer-sdk
```

---

🚀 Quick Start
-------------

[](#-quick-start)

```
use M1n64\ImageResizer\Client;

$client = new Client(
    xApiKey: null, // or 'your-api-key', if required
    baseUrl: 'http://localhost:5689',
    publicBaseUrl: 'http://localhost:5689', // optional, default is same as `baseUrl`. Used as image URL host
);

$image = $client->upload('/path/to/image.jpg');
echo $image->status->value; // 'pending', 'ready', etc.
```

---

🔧 Available Methods
-------------------

[](#-available-methods)

### ✅ Health Check

[](#-health-check)

```
$ping = $client->ping();
echo $ping->message; // "pong"
echo $ping->timestamp->format(DATE_ATOM);
```

### 📎 Upload via multipart

[](#-upload-via-multipart)

```
$image = $client->upload('/path/to/image.jpg');
```

### 🔢 Upload via binary stream

[](#-upload-via-binary-stream)

```
$image = $client->uploadBinary('/path/to/image.jpg');
```

### 📁 Upload from blob in memory

[](#-upload-from-blob-in-memory)

```
$imageData = file_get_contents('/path/to/image.jpg');
$image = $client->uploadFromBlob($imageData, 'my.jpg');
```

### 🔍 Get image by ID

[](#-get-image-by-id)

```
$image = $client->get('uuid-here');
echo $image->originalUrl;
echo $image->status->isReady() ? 'Ready' : 'Processing';
```

---

📊 Response Entity: `Image`
--------------------------

[](#-response-entity-image)

```
Image {
  UuidInterface $id
  string $originalUrl
  ?string $compressedUrl
  int $size
  string $mime
  ImageStatus $status
  ?Thumbnail[] $thumbnails
}
```

Enum `ImageStatus`: `pending`, `processing`, `ready`, `error`

You can call:

```
$image->status->isReady();
$image->status->isPending();
```

---

📖 Related
---------

[](#-related)

This SDK is made to work with the [Image Resizer Shared Service](https://github.com/m1n64/image-resizing-shared-service), which provides:

- A local HTTP/gRPC server
- Image compression to WebP
- Thumbnail generation
- Configurable via JSON or ENV
- Distributed as a standalone binary or Docker image

---

🎓 Tests
-------

[](#-tests)

```
composer test
```

Tests use full mocking of the HTTP layer (Guzzle), no external service required.

---

🧙‍♂️ Author
-----------

[](#‍️-author)

Made with ❤️ by the **[Kirill Sakharov](https://github.com/m1n64) ([LinkedIn](https://www.linkedin.com/in/kirill-sakharov-862072227/))**

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance49

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

2

Last Release

376d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/068f8c26f06f513a9c38d2a01c4d90a85eae1125a5b9d14eae7059715be860e4?d=identicon)[m1n64](/maintainers/m1n64)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/m1n64-imageresizer-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/m1n64-imageresizer-sdk/health.svg)](https://phpackages.com/packages/m1n64-imageresizer-sdk)
```

###  Alternatives

[opentok/opentok

OpenTok is a platform for creating real time streaming video applications, created by TokBox.

1413.0M10](/packages/opentok-opentok)[automattic/wistia-php

PHP wrapper for Wistia API

1431.9k](/packages/automattic-wistia-php)[daun/statamic-placeholders

Generate low-quality image placeholders for lazyloading Statamic assets

106.6k](/packages/daun-statamic-placeholders)[daun/statamic-mux

Seamless video encoding and streaming using Mux on Statamic sites

132.3k](/packages/daun-statamic-mux)

PHPackages © 2026

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