Download the PHP package sourcebroker/webp without Composer
On this page you can find all versions of the php package sourcebroker/webp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sourcebroker/webp
More information about sourcebroker/webp
Files in sourcebroker/webp
Package webp
Short Description Webp converter scenarios
License MIT
Informations about the package webp
webp
:local:
What does it do?
This library is short scenarios of working examples for webp on demand which use rosell-dk/webp-convert in background. There will be two scenarios:
1) call to image which has no webp version yet will redirect to original source and run webp image converter in background 2) call to image which has no webp version yet will stream original source and run webp image converter in background
Next calls to jpg/png will return webp on apache rewrite level.
For now only first scenario is implemented.
Webp images generated after redirect to original source
How to install ? ++++++++++++++++
composer req sourcebroker/webp
- Go to folder
vendor/sourcebroker/webp/Resources/WebpRedirectToOriginalAndConvertInBackground
- Copy part of htaccess from there to your htaccess or vhost configuration.
- Copy the example
webp.php
to your DocumentRoot folder. Change the path to vendor folder to your needs. - Your webp files will be stored in separate folder in your DocumentRoot folder. By default its
_processed_/webp-images
. You can change this folder by replacing_processed_/webp-images
in.htaccess
file and inwebp.php
file. - If you open folder
vendor/sourcebroker/webp/Resources/WebpRedirectToOriginalAndConvertInBackground/cms-specific
you will find therehtaccess
andwebp.php
for specific CMSes like for example TYPO3. The path to store files is there selected to best fit the CMS.
How to test? ++++++++++++
- Go into Network tab in Chrome DevTools. When you refresh website you should see jpg/png files being redirected to the
same url but with
?processing
parameter. - When you refresh the page second time some jpg/png should be already converted. Those will have
webp
in columnType
- Check you DocumentRoot folder there should be
_processed_/webp-images
folder created with webp files.