PHPackages                             rid/image-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. rid/image-bundle

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

rid/image-bundle
================

Handle file uploads, create and manage thumbnails Symfony2

066PHP

Since Oct 20Pushed 12y ago1 watchersCompare

[ Source](https://github.com/r1dd1ck777/image_bundle)[ Packagist](https://packagist.org/packages/rid/image-bundle)[ RSS](/packages/rid-image-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

RidImageBundle (beta)
=====================

[](#ridimagebundle-beta)

Provides handling uploaded files and thumbnail creation, clean templates and flexible configuration. [![Build Status](https://camo.githubusercontent.com/847261dfca6cd503e31fe56206a65c90e41f0ca074236a1ddf587f1dcc3d2467/68747470733a2f2f7472617669732d63692e6f72672f7231646431636b3737372f696d6167655f62756e646c652e706e67)](https://travis-ci.org/r1dd1ck777/image_bundle)

### Full documentation soon...

[](#full-documentation-soon)

### How it works

[](#how-it-works)

1. Store file name in database in a string
2. Replace PHP field representation from string to RidImage
3. Automatically inject configuration to RidImage
4. Automatically handle uploaded files according to configuration
5. Maximum parameters in config file (not in entities, services or templates)

### Twig Example:

[](#twig-example)

```
# config.yml:
rid_image:
    presets:
        user_avatars:
            path: uploads/user/avatars/
            default: image/default-user-avatar.png
            thumbnails:
                medium:
                    default: image/default-user-avatar-90.png
                    width: 90
                    height: 90
                    type: inset
                tiny:
                    default: image/default-user-avatar-30.png
                    width: 30
                    height: 20
                    type: outbound
    fields:
        Some\Bundle\Entity\User:
            avatar: user_avatars
```

```
// Twig:
// simply find user and then:
{{ asset(user.avatar) }}        // /uploads/user/avatars/random_name.jpg (full size)
{{ asset(user.avatar.small) }}  // /uploads/user/avatars/small_random_name.jpg (90x90)
{{ asset(user.avatar.tiny) }}   // /uploads/user/avatars/tiny_random_name.jpg (30x20)

// if image field is empty:
{{ asset(user.avatar) }}        // /image/default-user-avatar.png
{{ asset(user.avatar.small) }}  // /image/default-user-avatar-90.png
{{ asset(user.avatar.tiny) }}   // /image/default-user-avatar-30.png
```

### Installation

[](#installation)

1. Composer: "rid/image-bundle": "dev-master",
2. AppKernel: new Rid\\Bundle\\ImageBundle\\RidImageBundle(),
3. Config.yml:

```
doctrine:
    dbal:
        types:
            rid_image: Rid\Bundle\ImageBundle\DBAL\Types\RidImageType
            rid_file: Rid\Bundle\ImageBundle\DBAL\Types\RidFileType
        mapping_types:
            rid_image: rid_image
            rid_file: rid_file

rid_image:
    presets:
        # here you can create as many presets as you need
        somePresetName:
            path: uploads/category/
            thumbnails:
                small: # define eny name for thumbnails
                    width: 120
                    height: 70
                # add more thumbnails
    fields:
        Some\Bundle\Entity\Category:
            fieldName: somePresetName
            # add more fields
        # add more classes
```

Step 4: In Your entity class:

```
namespace Some\Bundle\Entity\Category;

use Doctrine\ORM\Mapping as ORM;
use Rid\Bundle\ImageBundle\Model\RidImage;

/
 * @ORM\Table()
 * @ORM\Entity()
 */
class Category
{
    /
     * @ORM\Column(type="rid_image", length=255, options={"default" = ""})
     */
    protected $image;

    public function __construct()
    {
        $this->image = new RidImage();
    }

    public function getImage()
    {
        return $this->image;
    }

    public function setImage($image)
    {
        $this->image = $image;
    }
}
```

Step 5: Set field type in form builder

```
    ->add('image', 'rid_image')
```

### Also implemented:

[](#also-implemented)

- Manual handling of uploaded files
- Events

### In future:

[](#in-future)

- frontend widgets (jcrop)
- grabbing from url
- more tests

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/013ca1d7ea6574b74720a9f4bc7f5821b8829dcc8f5021e13fc9d94ee1b99d6d?d=identicon)[mrriddick7@gmail.com](/maintainers/mrriddick7@gmail.com)

### Embed Badge

![Health badge](/badges/rid-image-bundle/health.svg)

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

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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