PHPackages                             zyx/widget-imagex - 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. zyx/widget-imagex

ActiveYii2-extension[Image &amp; Media](/categories/media)

zyx/widget-imagex
=================

Adding opengraph meta tags and microdata markdown to images

0.8.1(12y ago)156BSD-3-ClausePHP

Since May 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/SDKiller/zyx-widget-imagex)[ Packagist](https://packagist.org/packages/zyx/widget-imagex)[ RSS](/packages/zyx-widget-imagex/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

ImageX
======

[](#imagex)

[![Latest Stable Version](https://camo.githubusercontent.com/cd69279b67998f2db5a9c025b1e81b5f64c03825ed438e13105ad3d1855076ed/68747470733a2f2f706f7365722e707567782e6f72672f7a79782f7769646765742d696d616765782f762f737461626c652e706e67)](https://packagist.org/packages/zyx/widget-imagex)[![Latest Unstable Version](https://camo.githubusercontent.com/ebbbac8ef9533f98a2ed15994e521fb7e05cae262adbb3dae1afaa2562dfe4bd/68747470733a2f2f706f7365722e707567782e6f72672f7a79782f7769646765742d696d616765782f762f756e737461626c652e706e67)](https://packagist.org/packages/zyx/widget-imagex)[![Total Downloads](https://camo.githubusercontent.com/4c4462deebd3cf041e9bd9b3d8240898e9c2487984146660312fd71b6684ea42/68747470733a2f2f706f7365722e707567782e6f72672f7a79782f7769646765742d696d616765782f646f776e6c6f6164732e706e67)](https://packagist.org/packages/zyx/widget-imagex)[![License](https://camo.githubusercontent.com/ed00fbdedcdb63fba944763c6e5dbfa63c03b4d5b4f14dece6544e147e3723e1/68747470733a2f2f706f7365722e707567782e6f72672f7a79782f7769646765742d696d616765782f6c6963656e73652e706e67)](https://packagist.org/packages/zyx/widget-imagex)[![Code Climate](https://camo.githubusercontent.com/bdb6af7357913661f31da10b9d832aca661feb46fc2fff2270f4946193c6200f/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f53444b696c6c65722f7a79782d7769646765742d696d616765782e706e67)](https://codeclimate.com/github/SDKiller/zyx-widget-imagex)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a0bb2b2ca15391a869bd46c5f3fe670c65222b173ee256c14193ebba8c760472/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f53444b696c6c65722f7a79782d7769646765742d696d616765782f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/SDKiller/zyx-widget-imagex/)

Widget for simple generating OpenGraph meta tags and Schema.org markdown for images *('X' stands for 'eXtended')*.

You may do absolutely nothing - OpenGraph meta tags and Schema.org markdown will be generated 'on-the-fly' from image properties (which you can still define like you do in `Html::img()`).

REQUIREMENTS
------------

[](#requirements)

You should generally follow [Yii 2 requirements](https://github.com/yiisoft/yii2/blob/master/README.md). The minimum is that your Web server supports PHP 5.4.0.

INSTALLATION
------------

[](#installation)

### Install via Composer

[](#install-via-composer)

If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).

Either run

```
php composer.phar require --prefer-dist zyx/widget-imagex "*"

```

or add

```
"zyx/widget-imagex": "*"

```

to the require section of your composer.json.

USAGE
-----

[](#usage)

Just add following string to your layout

```
use zyx\widgets\ImageX;

```

And call widget where the image is supposed to be instead of usual `Html::img()`:

```
echo ImageX::widget([
                  'src' => 'http://static.yiiframework.com/css/img/logo.png',
                  'options' => ['width' => 280, 'height' => 60],
                  'og' => [],
                  'md' => ['div_class' => 'image_wrap']
                ]);

```

**Note:** only 'src' parameter is mandatory. Array of 'options' is the same you use for image options in `Html::img()`. If both 'og' (OpenGraph) and 'md' (schema.org) configuration arrays are empty - you may not declare them at all. You can to disable one of them (they are both enabled by default) - e.g. `'md' => ['enable' => false]`.

So, the result of example above should be something like this:
--------------------------------------------------------------

[](#so-the-result-of-example-above-should-be-something-like-this)

In the HEAD:

```
...

...

```

In the BODY ('img' is wrapped in 'div' tag):

```
...

...

```

Properties like 'width' and 'height' set explicitly in 'og' and 'md' configuration arrays, passed to widget, have priority. If no such options were set, widget attempts to extract properties from image 'options' array.

So you can just call:

```
echo ImageX::widget([
                  'src' => 'http://static.yiiframework.com/css/img/logo.png',
                  'options' => ['width' => 280, 'height' => 60]
                ]);

```

like you called `Html::img()` with no additional options.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

4394d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/99805?v=4)[Luke Andrew](/maintainers/zyx)[@zyx](https://github.com/zyx)

---

Top Contributors

[![SDKiller](https://avatars.githubusercontent.com/u/2150916?v=4)](https://github.com/SDKiller "SDKiller (15 commits)")

---

Tags

imageimagesopengraphschema.orgmicrodata

### Embed Badge

![Health badge](/badges/zyx-widget-imagex/health.svg)

```
[![Health](https://phpackages.com/badges/zyx-widget-imagex/health.svg)](https://phpackages.com/packages/zyx-widget-imagex)
```

###  Alternatives

[jbzoo/image

A PHP class that simplifies working with images

171126.9k3](/packages/jbzoo-image)[andrewgjohnson/imagettftextblur

imagettftextblur is a drop in replacement for imagettftext with added parameters to add blur, glow and shadow effects to your PHP GD images

27198.4k1](/packages/andrewgjohnson-imagettftextblur)[ayvazyan10/nova-imagic

Imagic is a Laravel Nova field package that allows for image manipulation capabilities, such as cropping, resizing, quality adjustment, and WebP conversion. It utilizes the powerful Intervention Image class for image manipulation.

144.3k1](/packages/ayvazyan10-nova-imagic)

PHPackages © 2026

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