laravel-image-optimizer icon indicating copy to clipboard operation
laravel-image-optimizer copied to clipboard

Options don't seem to taken into account

Open danjdewhurst opened this issue 7 years ago • 3 comments

It seems like any options I provide in the published configuration file aren't being passed to the OptimizerFactory. I'm using v2.3 with Laravel 5.2.

danjdewhurst avatar Jul 18 '17 14:07 danjdewhurst

How do you use this package?

Like https://github.com/approached/laravel-image-optimizer/blob/master/tests/ConvertJPGTest.php#L26 ?

approached avatar Jul 18 '17 14:07 approached

Here would the config file loaded.... https://github.com/approached/laravel-image-optimizer/blob/master/src/ServiceProvider.php#L22

approached avatar Jul 18 '17 14:07 approached

I was dd()ing the $options variable in \vendor\ps\image-optimizer\src\ImageOptimizer\OptimizerFactory.php, and it wasn't getting set. This was unless I removed the $this->app->singleton() wrapper from the approached/laravel-image-optimizer/blob/master/src/ServiceProvider.php construct, and it seemed to work fine again.

I'm not great with service providers, so I don't really understand what that $this->app->singleton() bit is for!

I apologise if I've brought up a non-issue.

danjdewhurst avatar Jul 18 '17 15:07 danjdewhurst