frosh / platform-thumbnail-processor
This plugins allows you to use variable thumbnails, without having them on storage.
Installs: 18 247
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 2
Forks: 10
Open Issues: 4
Type:shopware-platform-plugin
Requires
- nikic/php-parser: ^4.13.0
- shopware/core: ~6.5.0
Suggests
- dev-main
- 3.0.0
- 2.x-dev
- 2.0.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- v1.0.0
- dev-feature/exclude-file-extensions
- dev-supportBlurhashPlugin
- dev-specifyWidthAndHeight
This package is auto-updated.
Last update: 2023-06-01 12:55:06 UTC
README
This plugins allows you to use variable thumbnails, if your filesystem (or storage-adapter) supports it.
You can use this, if you don't want thumbnails to be created on you development-system, too.
It will add parameters to original image paths.
So you are able to save storage and add new thumbnails on the fly.
Version | Requirements |
---|---|
1.0.0 - 1.0.5 | Min. Shopware 6.0 |
1.0.6 - 1.0.15 | Min. Shopware 6.3 |
1.0.16 - 2.0.0 | Min. Shopware 6.4 |
3.0.0 | Min. Shopware 6.5 |
Install
Download the plugin from the release page and enable it in shopware.
By composer
composer require frosh/platform-thumbnail-processor
From source
Run npm install
in src/Resources/app/storefront
within the plugin directory
By zip
download latest release and upload into admin: https://github.com/FriendsOfShopware/FroshPlatformThumbnailProcessor/releases/latest/download/FroshPlatformThumbnailProcessor.zip
Usage
While active, this will access all thumbnails variable from original image. The thumbnail-files won't be needed anymore.
f.e.:
https://www.example.com/thumbnail/01/82/69/sasse_200x200.png
becomes:
https://www.example.com/media/01/82/69/sasse.png?width=200
You can edit the thumbnail-template within the plugin-config. Defaults {mediaUrl}/{mediaPath}?width={width}
.
Available variables with examples:
- {mediaUrl}: https://www.example.com/
- {mediaPath}: media/01/82/69/sasse.png
- {width}: 800
Feel free to decorate ThumbnailUrlTemplateInterface
to add more individual functions like signed imgproxy
Removing unneeded thumbnails
You may want to delete folder thumbnails
within folder public
Adding more thumbnail sizes:
- Save new size in the folder of the media management
- then run the command
bin/console media:generate-thumbnails
on the console to update the thumbnails for all images in the database - Clear shop cache
Find Patterns
You can find patterns in Github Discussions in category Patterns
License
The MIT License (MIT). Please see License File for more information.