PHPackages                             jdz/image - 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. [Templating &amp; Views](/categories/templating)
4. /
5. jdz/image

ActiveLibrary[Templating &amp; Views](/categories/templating)

jdz/image
=========

JDZ Image utils

1.0.2(2mo ago)04MITPHPPHP &gt;=8.2

Since Jan 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/joffreydemetz/image)[ Packagist](https://packagist.org/packages/jdz/image)[ Docs](https://jdz.joffreydemetz.com/image)[ RSS](/packages/jdz-image/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Image
=====

[](#image)

JDZ Image utilities for thumbnail generation, watermark protection, and HTML rendering.

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

[](#installation)

```
composer require jdz/image
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Symfony Filesystem ^7.2
- Symfony Finder ^7.2
- Imagine ^1.3
- GD extension

Usage
-----

[](#usage)

### Loading and Displaying Images

[](#loading-and-displaying-images)

```
use JDZ\Image\Image;

$image = new Image('/path/to/files', 'https://mywebsite.com/');
$image->load('media/photo.jpg', 'media/default.jpg');

$pic = $image->getPic('Photo description');
echo (string)$pic;
//
```

### Lazy Loading with Thumbnails

[](#lazy-loading-with-thumbnails)

```
use JDZ\Image\Image;

$image = new Image('/path/to/files', 'https://mywebsite.com/', 'thumbs');
$image->lazy = true;
$image->targetWidth = 800;
$image->cacheLife = 3600;
$image->load('media/photo.jpg');

$pic = $image->getPic('Photo');
echo (string)$pic;
// src points to thumbnail, data-src points to original
```

### Creating Thumbnails

[](#creating-thumbnails)

```
use JDZ\Image\Thumb;

$thumb = new Thumb('/path/to/files', 800, 'thumbs', 3600);
$created = $thumb->thumbImage('media/photo.jpg');

echo $thumb->thumbFile; // 'thumbs/media_photo-800.jpg'
```

### Watermark Protection

[](#watermark-protection)

```
use JDZ\Image\Copyright;

$copyright = new Copyright('/path/to/files', 'protect', 'watermark.png', 'repeat');

// Apply watermark (original backed up to protect/ folder)
$copyright->protectImage('media/photo.jpg');

// Restore original
$copyright->unprotectImage('media/photo.jpg');
```

### Filesystem Setup

[](#filesystem-setup)

```
use JDZ\Image\Fs;

$fs = new Fs('/path/to/files', 'media', 'thumbs', 'protect');
$fs->check(); // Creates media/, thumbs/, protect/ folders if missing
```

### Image Info

[](#image-info)

```
use JDZ\Image\Img;

$img = new Img('/path/to/files', 'media/photo.jpg');

if ($img->valid) {
    echo $img->width;       // 1600
    echo $img->height;      // 1200
    echo $img->orientation;  // 'landscape'
    echo $img->ext;          // 'jpg'
}
```

Testing
-------

[](#testing)

```
composer test
# or
vendor/bin/phpunit
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance83

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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 ~226 days

Total

3

Last Release

85d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.1

1.0.2PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e83e3701566e43438525ed14578487e732b849d152b5071aa1613a0dad96913?d=identicon)[jdz](/maintainers/jdz)

---

Top Contributors

[![joffreydemetz](https://avatars.githubusercontent.com/u/15113527?v=4)](https://github.com/joffreydemetz "joffreydemetz (8 commits)")

---

Tags

imagetemplateutilitiesJDZ

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)

PHPackages © 2026

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