jsThumbnailPlugin - 1.1.0

The jsThumbnailPlugin is a symfony plugin that creates Thumbnails on the fly using the GD library.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to the Plugins Home


Forgot your password?
Create an account



advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

jsTumbnailPlugin - Plugin for on-the-fly Thumbnails Creation


The plugin provides Creates Thumbnails on the fly using GD for the symfony php framework. It uses the Symfony cache system to cache the thumbnails. It creates a thumbnail of a image in the given size and stores it in cache for the next calls, until the image changes.


For the full copyright and license information, please view the LICENSE file that was distributed with this source code.


To install the plugin use symfony plugin-install command

symfony plugin-install http://plugins.symfony-project.com/jsTumbnailPlugin

Using the plugin

Enable one or more modules in your settings.yml * jsThumbnail

    enabled_modules:        [jsThumbnail ]( default,)

In your template call something like this:

 'border: 1px solid #ff0000')) ?> 
//'/path/to/image.jpg',maximum width, maximum height, params

The Parameter "mode" can be "normal", "crop" or "stretch" you can call the Thumbnail directly: www.yourhost.com/yourapp.php/jsThumbnail/thumbnail?img=uploads/pictures/image.jpg&maxx=100&maxy=80&mode=crop

<?php use_helper('Thumbnail') ?>

<?php echo thumbnail_tag('uploads/pictures/offer/54fbcc52d9ec1af3decd50aeed9f5517.jpg',100, 80, 'stretch' array('style' => 'border: 1px solid #ff0000')) ?>

The Plugin automatically checks if the Original image was modificated. To delete the cached thumbnails call:

symfony cc