Download the PHP package octfx/webp without Composer

On this page you can find all versions of the php package octfx/webp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package webp

WebP Extension

Upon file upload this extension creates a WebP (and Avif if active) version of the uploaded image and its thumbs.

Requires a working job queue, Extension:PictureHtmlSupport, and a usable version of imagick, libwebp (cwebp), or gd installed.
As well as $wgHashedUploadDirectory = true;, and if Extension:AWS is active $wgAWSRepoHashLevels to be >0;

Setting $wgGenerateThumbnailOnParse = false; is currently not supported.

How does this work?

After an upload or file transformation, a transform job is dispatched that creates a webp (and avif if active) file version of the original file.

Additionally, the PictureHtmlSupport extension exposes a hook when a thumbnail is added to the page output.
Extension:WebP utilizes this hook to add a <source> element for each active image transformer.

Converting already uploaded images

A maintenance script exists to convert already uploaded images:

Installation

Configuration

Key Description Example Default
$wgWebPEnableConvertOnUpload Enables file creation after a new image was uploaded. Doesn't work for copy uploads. true true
$wgWebPEnableConvertOnTransform Enables file creation after a thumbnail was created. This isn't necessary if a thumbhandler is active. false true
$wgWebPEnableResponsiveVersionJobs Dispatch transform jobs for 1.5x and 2x file versions. Note: This runs for each thumbnail inclusion and may be disabled after all present thumbnails have been converted. false true
$wgWebPCheckAcceptHeader Check if the accept header contains webp. If not the original file will be served. true false
$wgWebPCompressionQuality Compression Quality. Lower means worse. 50 75
$wgWebPCompressionQualityAvif Compression Quality for Avif files. Lower means worse. 50 30
$wgWebPFilterStrength Alpha compression strength. Sets imagick webp:alpha-quality and cwebp -alpha_q. Lossless is 100. 50 80
$wgWebPAutoFilter Enables the auto filter. This algorithm will spend additional time optimizing the filtering strength to reach a well-balanced quality. false true
$wgWebPThumbSizes Thumbnail Sizes to create through the maintenance script [2400] [120, 320, 800, 1200, 1600]
$wgEnabledTransformers List of enabled image transformers [ "MediaWiki\Extension\WebP\Transformer\AvifTransformer", "MediaWiki\Extension\WebP\Transformer\WebPTransformer" ] WebP Transformer
$wgWebPCWebPLocation Path to cwebp executable /usr/bin/cwebp
$wgWebPAvifencLocation Path to avifenc executable /usr/bin/avifenc

Enabling Avif

For full feature support you'll need to install Imagick v7, als v6.9 has multiple bugs.
Alternatively you can install libavif-bin (>= 0.9.3) which provides avifenc. Do note that this still requires a version of imagick installed, as avifenc can't rescale images.

When enabling the Avif transformer, make sure that it is ordered before the webp transformer, as else the browser will pick the webp version.

De-Installation

Delete the folders images/webp and images/thumbs/webp and remove the extension.
If the Avif transformer is active remove images/avif and images/thumbs/avif.


All versions of webp with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
ext-imagick Version *
composer/installers Version >=1.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package octfx/webp contains the following files

Loading the files please wait ....