This plugin adds remoteThumbnail support for imgproxy.
composer require netlogix/nlx-sw-imgproxyYou can configure the plugin over the Shopware plugin configuration or add the following configuration to your config/packages/shopware.yaml file:
| option | default | description |
|---|---|---|
| enable | false | |
| baseUrl | null | The imgproxy baseUrl |
| resizeType | null | The resize type for imgproxy |
| imageSource | null | The image source for imgproxy |
| key | null | The key for signing a URL |
| salt | null | The salt for signing a URL |
Only if enable is set to true and baseUrl is defined, the plugin will use imgproxy to generate remote thumbnails.
Only if key and salt are set, the plugin will sign the URLs.
There are two ways to add additional processing options for imgproxy:
Define a default preset in your imgproxy. for example:
IMGPROXY_PRESETS="default=q:85"
You can decorate the UrlGenerator to add additional processing options for imgproxy.
This method getImagePath allows you to modify the URL path that is generated by the plugin.
You need an instance of imgproxy running to use this plugin.
You can run it locally or in a docker container darthsim/imgproxy.
You have to enable remote_thumbnails
shopware:
media:
remote_thumbnails:
enable: trueI recommend use the shopware.system_config to configure the plugin.
for example in your config/packages/shopware.yaml file:
shopware:
system_config:
default:
NlxSwImgproxy.config.enable: true
NlxSwImgproxy.config.baseUrl: 'https://public.imgproxy.domain'
NlxSwImgproxy.config.key: '%env(IMGPROXY_KEY)%'
NlxSwImgproxy.config.salt: '%env(IMGPROXY_SALT)%'