jsThumbnailPlugin - 1.0.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

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

jsThumbnailPlugin

Plugin for on-the-fly Thumbnails Creation

The jsThumbnailPlugin is a symfony plugin that creates Thumbnails on the fly using the GD library. 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.

License

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

Installation

  • To install the plugin use symfony plugin-install command

    $ symfony plugin-install http://plugins.symfony-project.com/jsThumbnailPlugin 
    

Using the plugin

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

    all:
      .settings:
         enabled_modules:        [ default, jsThumbnail ]
  • In your template call something like this:

    <?php use_helper('Thumbnail') ?>
     
    <?php echo thumbnail_tag('uploads/pictures/image.jpg',100, 80, array('style' => 'border: 1px solid #ff0000')) ?> 
    //'/path/to/image.jpg',maximum width, maximum height, params
  • you can call the Thumbnail directly:

    www.yourhost.com/yourapp.php/jsThumbnail/thumbnail?img=uploads/pictures/image.jpg&maxx=100&maxy=80
    
  • The Plugin automatically checks if the Original image was modificated.

  • To delete the cached thumbnails call:

    $ symfony cc