imagecache icon indicating copy to clipboard operation
imagecache copied to clipboard

Added variables to the template classes in the config file

Open akempes opened this issue 9 years ago • 1 comments

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.

akempes avatar Jul 27 '16 19:07 akempes

Sounds like a very good idea : i actually had the case and had to duplicate a lot of filters only for sizing variation. +1

LaurentChardin avatar Jul 13 '17 19:07 LaurentChardin