PHPackages                             palap/imagetag-bundle - 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. palap/imagetag-bundle

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

palap/imagetag-bundle
=====================

Symfony2 image tag. Add colored tags with label to your image on symfony 2.3.

2.3(12y ago)025MITJavaScript

Since Aug 26Pushed 11y agoCompare

[ Source](https://github.com/pascallapointe/ImageTagBundle)[ Packagist](https://packagist.org/packages/palap/imagetag-bundle)[ Docs](https://github.com/pascallapointe/ImageTagBundle)[ RSS](/packages/palap-imagetag-bundle/feed)WikiDiscussions master Synced 2d ago

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

ImageTagBundle
--------------

[](#imagetagbundle)

The ImageTagBundle allows you to add tags to your images. Tags takes the form of a box of a different color followed by a label. Tags are stored in your database every times you make a change on it.

To use it, the bundle provide:

- A twig function for creating tags
- A twig function to display images with their tags.

**Note:**

- This bundle has been tested on Firefox, Chrome, Safari and Symfony 2.3.x
- Thank you to share all issues regarding this bundle

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

[](#installation)

Using **composer** file with Symfony 2.3.x :

```
"require": {
    //...,
    "palap/imagetag-bundle": "dev-master"
},

```

Subsequently add the following line to **AppKernel.php** :

```
new Palap\ImageTagBundle\PalapImageTagBundle(),

```

In **app/config/routing.yml** add the following:

```
palap_imagetag:
	resource: "@PalapImageTagBundle/Resources/config/routing.yml"
	prefix: imagetag/

```

In your **HTML** file, add those lines:

```

```

And don't forget to run those 3 commands:

```
app/console doctrine:schema:update --force
app/console assets:install --symlink web
app/console assetic:dump --env=prod

```

Simple usage
------------

[](#simple-usage)

#### Adding tags

[](#adding-tags)

**Note:** 'theScope' must be different for every image you want to display on a same document. It's an HTML Id.

```
{{ setImageTag (
    'image/IMG001.jpg',
    'theScope',
    'optional - Image Alt property'
) }}

```

**Explanation :**

- The first parameter is the **path** of the picture, it is possible to use any twig function returning a path as [GregwarImageBundle](https://github.com/Gregwar/ImageBundle) functions.
- The second parameter will be used as **Scope** to allow the js script distinguishes different images.
- Tags associated with images considering the file name, the width and height of the image.
- Creating tags is secure according to the following role : `IS_AUTHENTICATED_FULLY`, you can change it by extending the bundle controller.

#### Display tags

[](#display-tags)

```
{{ imageTag (
    'image/IMG001.jpg',
    'theScope',
    'optional - Image Alt property'
) }}

```

Usage with custom controller
----------------------------

[](#usage-with-custom-controller)

It is possible to use a controller with twig custom functions to modify the way the script will save the tags.

### Adding tags - custom controller

[](#adding-tags---custom-controller)

```
{{ setImageTag (
    entity.filePath,
    'theScope',
    'Not optional - Image Alt property',
    path('MyCustomControllerRoute', {'id':entity.id, 'fieldName':'file', 'otherUsefulParameters':parameters})
) }}

```

**Explanation :**

- MyCustomControllerRoute is the route used by the Ajax request
- You **must definitely** specify a parameter in your way, even if it is a decoy to initiate the "*query string*"
- The query string added to your *Route* by the script **js** is as follows :

    ```
    '&init=' + init + '&width=' + imageWidth + '&height=' + imageHeight
    + '&htmlcontent=' + encodeURIComponent($('.tagz', context).html())

    ```
- **init** is equal to true on the first query, used for initialization purpose
- **htmlcontent** contains tags to save

### Display tags - custom controller

[](#display-tags---custom-controller)

```
{{ imageTag (
    entity.filePath,
    'theScope',
    'Not optional - Image Alt property',
    path('MyCustomControllerRoute', {'id':entity.id, 'fieldName':'file', 'otherUsefulParameters':parameters})
) }}

```

Other
-----

[](#other)

#### Displaying tags

[](#displaying-tags)

If you only need to display the tags you're free to only include `imagetag-display.js`.

In that file I also include the `showTags({{theScope}})` and `hideTags({{theScope}})` js function that will help you to hide and display all tags at once.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

4643d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca1d7f35ad06eafb7d33e2bb019bcff4b5c205adcec83513e297a7f62f0e2bce?d=identicon)[pascallapointe](/maintainers/pascallapointe)

---

Top Contributors

[![pascallapointe](https://avatars.githubusercontent.com/u/3847945?v=4)](https://github.com/pascallapointe "pascallapointe (10 commits)")

---

Tags

imagetagimage tagimage comment

### Embed Badge

![Health badge](/badges/palap-imagetag-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/palap-imagetag-bundle/health.svg)](https://phpackages.com/packages/palap-imagetag-bundle)
```

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k38.3M217](/packages/liip-imagine-bundle)[spatie/image

Manipulate images with an expressive API

1.4k54.4M138](/packages/spatie-image)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[intervention/gif

PHP GIF Encoder/Decoder

5520.3M9](/packages/intervention-gif)

PHPackages © 2026

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