PHPackages                             evought/data-uri - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. evought/data-uri

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

evought/data-uri
================

A convenient class for working with Data URIs in PHP.

v1.0(11y ago)19.5k1MITPHPPHP &gt;=5.4.0

Since Feb 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/evought/DataURI)[ Packagist](https://packagist.org/packages/evought/data-uri)[ RSS](/packages/evought-data-uri/feed)WikiDiscussions master Synced 1mo ago

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

README.md

Eric Vought

2015-01-25 DataURI PHP library

\#What This Project Is#

The DataUri class provides a convenient way to access and construct data URIs, but should not be relied upon for enforcing RFC 2397 standards.

This class will not:

- Validate the media-type provided/parsed
- Validate the encoded data provided/parsed

Examples of how to use the class are in FlyingTopHat's blog post, ["Using Data URI's in PHP"](http://www.flyingtophat.co.uk/blog/2012/09/08/using-data-uris-in-php.html).

\#Source and History#

DataURI is a class originally written by [FlyTopHat](http://www.flyingtophat.co.uk) and was used as an example in a [2012 blog post](http://www.flyingtophat.co.uk/blog/2012/09/08/using-data-uris-in-php.html) and as a [Gist](https://gist.github.com/FlyingTopHat/3661056).

In 2014, I forked the Gist in order to package it as a micro-library for use by Composer as a dependency in other projects. Using a Gist-based micro-library in composer requires creating a custom VCS-based repository in your composer.json. This is clunky but acceptable in an application but becomes difficult if the host project is itself used as a Composer-dependency because the custom repository definition is not (by design) included in the host project. The repository definition and package requirement must be repeated in each enclosing project--- effectively defeating the purpose of automatic dependency management.

So, in 2015, I forked my fork of DataURI, this time to move it to a full-fledged GitHub repository so that it could be made into an actual composer-managed library in the Packagist repository and the extra machinery needed to turn it into a production component could be added.

\#Licensing#

All components are under an MIT license. FlyingTopHat added an MIT license to the original GIST on 2 February 2015 to clarify original license.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

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

4122d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cbed6724cbe9eb4cbde99c4f7e490c9bc987456a88ff4e8f6ffb7b18dd7179c?d=identicon)[evought](/maintainers/evought)

---

Top Contributors

[![FlyingTopHat](https://avatars.githubusercontent.com/u/951864?v=4)](https://github.com/FlyingTopHat "FlyingTopHat (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/evought-data-uri/health.svg)

```
[![Health](https://phpackages.com/badges/evought-data-uri/health.svg)](https://phpackages.com/packages/evought-data-uri)
```

PHPackages © 2026

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