PHPackages                             symfony-helper/media-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. [HTTP &amp; Networking](/categories/http)
4. /
5. symfony-helper/media-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

symfony-helper/media-bundle
===========================

This Bundle provides tools to rapidly process image with Symfony

V0.1.0(9y ago)0421[1 issues](https://github.com/itcreator/MediaBundle/issues)BSD-3PHPPHP &gt;=7.0.1

Since Jun 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/itcreator/MediaBundle)[ Packagist](https://packagist.org/packages/symfony-helper/media-bundle)[ Docs](https://github.com/itcreator/MediaBundle)[ RSS](/packages/symfony-helper-media-bundle/feed)WikiDiscussions master Synced 1mo ago

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

Symfony media bundle
====================

[](#symfony-media-bundle)

This Bundle provides tools to rapidly process image with Symfony

Instalation
===========

[](#instalation)

### add package to composer

[](#add-package-to-composer)

```
    "symfony-helper/media-bundle": "@dev",

```

### Register bundle in AppKernel

[](#register-bundle-in-appkernel)

```
    public function registerBundles()
        {
            $bundles = [
                ...
                new SHelper\MediaBundle\SHelperMediaBundle(),
                ...
            ];

            ...

            return $bundles;
        }
```

Configuration
=============

[](#configuration)

### Add configuration config to config.yml

[](#add-configuration-config-to-configyml)

```
s_helper_media:
    original_resolution:
        width: 1920
        height: 1080
    previews:
        small:
            width: 32
            height: 32
        thumbnail:
            width: 640
            height: 480
        ... other resolutions
```

Preview section is not required. Parameters `small` and `thumbnail` are only example. You can define custom subsections in preview section.

### Configure Doctrine ORM mapping

[](#configure-doctrine-orm-mapping)

```
doctrine:
    orm:
        mappings:
            AppBundle:      # this is only example section
                type: annotation
                prefix: App\Entity
            SHelperMediaBundle:     # Media bundle mapping
                type: annotation
                dir: "Model/Entity"
                prefix: SHelper\MediaBundle\Model\Entity
```

Usage
=====

[](#usage)

Steps:

- Upload an image and get image ID in response. (Not multipart)
- Attach this image to you custom entity
- Enjoy and be happy

Media bundle will create entity `Image`. You must make a unidirectional relation to this `Image` entity.

### Add an unidirectional relation

[](#add-an-unidirectional-relation)

```
/**
 * User
 *
 * @ORM\Table(name="`user`")
 * @ORM\Entity
 */
class User implements UserInterface
{
    ...
    /**
     * @var Image
     *
     * @ORM\OneToOne(targetEntity="SHelper\MediaBundle\Model\Entity\Image")
     * @ORM\JoinColumn(name="avatar_id", referencedColumnName="id", nullable=true)
     */
    private $avatar;
    ...
}
```

### Create image manually

[](#create-image-manually)

Inject image service to your service.

```
    class YourService
    {
        /** @var IImageService */
        private $imageService;

        public function __construct(IImageService $imageService)
        {
            $this->imageService = $imageService;
        }
        ...

        public function doSomething()
        {
            $imageBlob = file_get_contents('filename.jpg');
            $image = $this->imageService->createImageFromBlob($imageBlob);

            ...

            $user->setAvatar($image);
            //OR
            $article->setAvatar($image);
            //OR
            $someThingElse->setAvatar($image);
        }
    }
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

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

3627d ago

### Community

Maintainers

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

---

Top Contributors

[![itcreator](https://avatars.githubusercontent.com/u/928509?v=4)](https://github.com/itcreator "itcreator (1 commits)")

---

Tags

rest

### Embed Badge

![Health badge](/badges/symfony-helper-media-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/symfony-helper-media-bundle/health.svg)](https://phpackages.com/packages/symfony-helper-media-bundle)
```

###  Alternatives

[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[api-platform/doctrine-orm

Doctrine ORM bridge

243.1M39](/packages/api-platform-doctrine-orm)[ecentria/ecentria-rest-bundle

Goal of this bundle is to simplify process of creating APIs with Symfony. We use already well-coded libraries, combine them together to simplify process and not to re-invent the wheel. We've chose REST and HATEOS to have unified standards of API requests and responses.

142.4k](/packages/ecentria-ecentria-rest-bundle)[gointegro/hateoas-bundle

GOintegro HATEOAS Bundle

6810.6k](/packages/gointegro-hateoas-bundle)[gointegro/hateoas

GOintegro HATEOAS Lib

408.0k1](/packages/gointegro-hateoas)

PHPackages © 2026

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