imagecache
imagecache copied to clipboard
Added variables to the template classes in the config file
Hi,
After a few projects I noticed that I'm actually using one particular (custom) template over and over again, but the only differences are the image sizes.
I made a couple of changes in the packages to add arguments in the template definition.
'templates' => array(
'small' => 'Intervention\Image\Templates\Small',
'medium' => ['class'=>'Intervention\Image\Templates\Medium'],
'large' => ['class'=>'Intervention\Image\Templates\large', 'args'=>['w'=>200,'h'=>200]],
)
As you can see the changes won't break the existing configuration for this package.
I'm about to issue a pull request for the other image package as well because the applyFilter function will get a second parameter, the $args variable.
Sounds like a very good idea : i actually had the case and had to duplicate a lot of filters only for sizing variation. +1