Mittwoch, 3. Dezember 2008

New version of jsThumbnailPlugin released

Today I have released version 1.1.0 of the jsThumbnailPlugin for the Symfony framework. It contains a important bugfix for Symfony 1.1 and a new feature.

I fixed a bug with the sfFileCache object: In version 1.0 the sfFileCache wants a string as $file_cache_dir parameter, but version 1.1 wants a Array containing the parameters:

Symfony 1.0: $cache = new sfFileCache($file_cache_dir);
Symfony 1.1: $cache = new sfFileCache(Array('cache_dir'=>$file_cache_dir));

The problem was to find out which version of Symfony is running. I solved the problem by checking if the function "setFileLocking" exists. This function exists only in version 1.0 of Symfony:

if (method_exists('sfFileCache', 'setFileLocking')){ //symfony 1.0
$cache = new sfFileCache($file_cache_dir);
}else{ //symfony 1.1
$cache = new sfFileCache(array('cache_dir' => $file_cache_dir));

jsThumbnailPlugin 1.1.0 accepts a new parameter "mode". This parameter can be set to "normal", "crop" or "stretch".
normal: Sets the image to the maximum height or width, without changing the width/height proportion;
crop: The image will be cropped exactly to the given height and width without changing the width/height proportion;
stretch: Sets the image to the maximum height or width, the width/height proportion changes.

Dienstag, 2. Dezember 2008

New great set of 24 Symfony tutorials

The Symfony team has released a new set of 24 tutorials published day-by-day between December 1st and Christmas, like the "Askeet tutorial" in 2005.

As for askeet, every day including week-ends, a new tutorial will be published. Each tutorial is meant to last about one hour, and will be the occasion to learn symfony by coding a real web application, from start to finish.