Home > jsThumbnailPlugin

jsThumbnailPlugin

JsThumbnailPlugin is a project mainly written in PHP, based on the MIT license.

git clone of the jsThumbnailPlugin

= jsTumbnailPlugin - Plugin for on-the-fly Thumbnails Creation =

== Overview ==

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.

== 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/jsTumbnailPlugin

}}}

== 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 echo thumbnail_tag('uploads/pictures/image.jpg',100, 80, 'crop' array('style' => '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

}}}

Previous:sunsol-conf