You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be great if the package supports flexible resizing, effects etc. through url parameters. This can "almost" be done, but the image cache does not support this:
In short:
Issue: ImageCache does not support url parameters, but takes only filename as cache key
possible solutions:
allow to configure custom implementation of ImageCache
allow to pass cache key parameters through applyFilter() method
working example for 'dynamic' filter:
public function applyFilter(Image $image)
{
// issue:
// parameter is not added to cachekey
// w = width in px
$width =request()->input('w');
$quality =request()->input('q') ?? 90;
$image->resize($width, null, function ($constraint) {
$constraint->aspectRatio();
})
->encode('jpg', $quality)
;
return $image;
}
Would be great if the package supports flexible resizing, effects etc. through url parameters. This can "almost" be done, but the image cache does not support this:
In short:
Issue: ImageCache does not support url parameters, but takes only filename as cache key
possible solutions:
applyFilter()
methodworking example for 'dynamic' filter:
example requests:
http://yourhost.com/{route-name}/original/{file-name}?w=100&q=50
http://yourhost.com/{route-name}/original/{file-name}?w=200&q=90
both urls will return the same cached image (whichever was called first) as the cache key does not support parameters.
The text was updated successfully, but these errors were encountered: