PHPackages                             odinshat/tyre-label-generator - 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. odinshat/tyre-label-generator

ActiveLibrary

odinshat/tyre-label-generator
=============================

PHP library Tyre Label Generator compatible with EU Tyre Label styling and standards

v2.1.0(5y ago)74822[2 issues](https://github.com/OdinsHat/tyre-label-generator/issues)BSD-3-ClausePHPPHP &gt;=7.1CI failing

Since Nov 17Pushed 4y ago4 watchersCompare

[ Source](https://github.com/OdinsHat/tyre-label-generator)[ Packagist](https://packagist.org/packages/odinshat/tyre-label-generator)[ Docs](https://github.com/OdinsHat/tyre-label-generator)[ RSS](/packages/odinshat-tyre-label-generator/feed)WikiDiscussions master Synced today

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

Tyre Label Generator
====================

[](#tyre-label-generator)

[![Build Status](https://camo.githubusercontent.com/963e56343db64dc19c27c8c0b22ae8caea547ff81279e3f69199335a93eb6e10/68747470733a2f2f7472617669732d63692e6f72672f4f64696e734861742f747972652d6c6162656c2d67656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/OdinsHat/tyre-label-generator) [![License](https://camo.githubusercontent.com/b3775a2de17853a90995faa104f941eef3ad3c40cc89e34b8b1eaea014614d4e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d2d436c617573652d626c75652e737667)](https://opensource.org/licenses/BSD-3-Clause) [![PRs Welcome](https://camo.githubusercontent.com/25b3e6d0d42c98de74a98cbb4d149a1c09020cf6d1361993b72d7d5b8ffed363/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://makeapullrequest.com)

Important
=========

[](#important)

As of May 2021 the EU tyre label format is changing. This is known and development **will** be progressing as fast as possible to implement the changes. Please feel free to submit any PRs or make any suggesstions using the issues facility of Github.

Many thanks for your patience. For the time being you can view details of the changes that are coming in the [following link](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32020R0740) (scroll down to annex 1). You will also find the English documentation in the docs directory where I will also be placing all other EU languages documentation at a later date.

### Background

[](#background)

In the EU tyre labelling went into effect from 1st November 2012. This is a PHP library capable of generating images and HTML/CSS stacked images of EU tyre labels. EU tyre lavbel design hasn't changed since 2012 so this library is still valid as of 2020.

Example Output
--------------

[](#example-output)

[![Example Tyre Label](https://raw.githubusercontent.com/OdinsHat/tyre-label-generator/master/images/tyre-label-ex.png)](https://raw.githubusercontent.com/OdinsHat/tyre-label-generator/master/images/tyre-label-ex.png)

*The above was generated (then screenshot) using the genHtmlLabel method of the class*

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

[](#installation)

The easiest way is to simply use composer to require the package:

`composer require odinshat/tyre-label-generator`

However, you can choose one of 2 versions dependent on your requirements.

- The PHP7+ version which is [version 2.0+](https://github.com/OdinsHat/tyre-label-generator/tree/v2.0.0)
- The PHP5.4-compatible version whose [latest working version was v1.2](https://github.com/OdinsHat/tyre-label-generator/tree/v1.2)

Testing
-------

[](#testing)

Version 2.0+ which is the PHP7 version of the library comes with a full suite of tests which you can run using PHPUnit:

```
git clone git@github.com:OdinsHat/tyre-label-generator.git
cd tyre-label-generator
phpunit tests/

```

You can also run the composer scripts `analyze` and `fix` with the first being the Psalm (PHP-Stan on steroids) and the second being PHPCSFixer.

Usage
-----

[](#usage)

There are multiple methods implemented in the class and you can use whichever suits yur needs most.

### 1. HTML Generated Image

[](#1-html-generated-image)

This method uses a set of identically sized images and overlays them to create the required full label type using **inline** CSS to ensure they align on top of each other. This isn't the recommended way but is by far the easiest to get going.

E.g.

```
$tyre = new Tyre('F', 'E', 71, 2);
$label = new Label($tyre);
echo $label->genHtmlLabel();
```

The outputted HTML would look something like this:

```

```

### 2. HTML/CSS Generated Image

[](#2-htmlcss-generated-image)

This will require you to include the provided CSS file `tyre-label.css`somewhere in your page or add its styles to your own.

```
$tyre = new Tyre('F', 'E', 71, 2);
$label = new Label($tyre, 300, '/imgs');
echo $label->genCssLabel();
```

```

```

### 3. PNG Generated Image

[](#3-png-generated-image)

```
$tyre = new Tyre('F', 'E', 71, 2,280,"images/");
$label = new Label($tyre, 250);
$image = $label->genPngLabel();
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
die();
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% 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 ~467 days

Total

5

Last Release

1959d ago

Major Versions

v1.2 → v2.0.02020-12-27

PHP version history (3 changes)v1.0PHP &gt;=5.3

v2.0.0PHP &gt;=7.0

v2.1.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1061673?v=4)[Doug](/maintainers/OdinsHat)[@OdinsHat](https://github.com/OdinsHat)

---

Top Contributors

[![OdinsHat](https://avatars.githubusercontent.com/u/1061673?v=4)](https://github.com/OdinsHat "OdinsHat (90 commits)")[![restyled-commits](https://avatars.githubusercontent.com/u/65077583?v=4)](https://github.com/restyled-commits "restyled-commits (1 commits)")

---

Tags

imagesimage-generatoreutyretireregulations

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/odinshat-tyre-label-generator/health.svg)

```
[![Health](https://phpackages.com/badges/odinshat-tyre-label-generator/health.svg)](https://phpackages.com/packages/odinshat-tyre-label-generator)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k37.7M471](/packages/spatie-laravel-medialibrary)[desandro/imagesloaded

JavaScript is all like \_You images done yet or what?\_

8.9k439.0k1](/packages/desandro-imagesloaded)[spatie/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

1.5k4.7M20](/packages/spatie-laravel-cookie-consent)[rosell-dk/webp-convert

Convert JPEG &amp; PNG to WebP with PHP

6038.1M54](/packages/rosell-dk-webp-convert)[tinify/tinify

PHP client for the Tinify API. Tinify compresses your images intelligently. Read more at https://tinify.com.

2515.2M72](/packages/tinify-tinify)

PHPackages © 2026

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