{"id":15704094,"url":"https://github.com/octfx/mediawiki-extension-webp","last_synced_at":"2025-07-03T13:33:09.937Z","repository":{"id":42017558,"uuid":"322389754","full_name":"octfx/mediawiki-extension-WebP","owner":"octfx","description":"[UNMAINTAINED] Convert image files on upload to WebP","archived":false,"fork":false,"pushed_at":"2024-09-19T08:58:21.000Z","size":268,"stargazers_count":7,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-05-30T11:57:26.660Z","etag":null,"topics":["mediawiki-extension"],"latest_commit_sha":null,"homepage":"https://mediawiki.org/wiki/Extension:WebP","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-17T19:16:08.000Z","updated_at":"2025-05-27T06:33:58.000Z","dependencies_parsed_at":"2023-01-30T20:31:37.240Z","dependency_job_id":"8f77b7ec-026c-4ae5-a3e4-be01ad85d79c","html_url":"https://github.com/octfx/mediawiki-extension-WebP","commit_stats":{"total_commits":124,"total_committers":6,"mean_commits":"20.666666666666668","dds":"0.040322580645161255","last_synced_commit":"53f49a517c3e381c0cc62298820ceee5a0c525a4"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/octfx/mediawiki-extension-WebP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extension-WebP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extension-WebP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extension-WebP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extension-WebP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octfx","download_url":"https://codeload.github.com/octfx/mediawiki-extension-WebP/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extension-WebP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263335549,"owners_count":23450875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mediawiki-extension"],"created_at":"2024-10-03T20:10:18.634Z","updated_at":"2025-07-03T13:33:09.905Z","avatar_url":"https://github.com/octfx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebP Extension\nUpon file upload this extension creates a WebP (and Avif if active) version of the uploaded image and its thumbs.\n\nRequires a working job queue, [Extension:PictureHtmlSupport](https://github.com/StarCitizenWiki/mediawiki-extensions-PictureHtmlSupport), and a usable version of `imagick`, `libwebp (cwebp)`, or `gd` installed.  \nAs well as `$wgHashedUploadDirectory = true;`, and if Extension:AWS is active `$wgAWSRepoHashLevels` to be `\u003e0`;\n\nSetting `$wgGenerateThumbnailOnParse = false;` is currently not supported.\n\n## How does this work?\nAfter an upload or file transformation, a transform job is dispatched that creates a webp (and avif if active) file version of the original file.  \n\nAdditionally, the PictureHtmlSupport extension exposes a hook when a thumbnail is added to the page output.  \nExtension:WebP utilizes this hook to add a `\u003csource\u003e` element for each active image transformer.\n\n## Converting already uploaded images\nA maintenance script exists to convert already uploaded images:\n```shell\nphp extensions/WebP/maintenance/CreateFromLocalFiles.php\n\n# To only convert non-thumbnails run\nphp extensions/WebP/maintenance/CreateFromLocalFiles.php --no-thumbs\n\n# To create thumbnails of custom sizes run\n# This will create two thumbnails with size 1000px and 1250px\nphp extensions/WebP/maintenance/CreateFromLocalFiles.php --thumb-sizes=1000,1250\n\n# To only work on some images run\nphp extensions/WebP/maintenance/CreateFromLocalFiles.php --titles=ImageA.jpg,ImageB.png\n\n# To force the creation of already existing images run\nphp extensions/WebP/maintenance/CreateFromLocalFiles.php --overwrite\n\n# Only work on page titles matching a prefix\n# Every page starting with prefix 'Example' will be selected\nphp extensions/WebP/maintenance/CreateFromLocalFiles.php --title-prefix=Example\n\n# Only work on page titles matching a file-type\n# Every page starting with file-type 'png' will be selected\n# Can be combined with 'title-prefix'\nphp extensions/WebP/maintenance/CreateFromLocalFiles.php --file-type=png\n```\n\n## Installation\n\n```php\nwfLoadExtension( 'WebP' );\n```\n\n\n## Configuration\n| Key                                | Description                                                                                                                                                               | Example                                                                                                                    | Default                     |\n|------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|-----------------------------|\n| $wgWebPEnableConvertOnUpload       | Enables file creation after a new image was uploaded. Doesn't work for copy uploads.                                                                                      | true                                                                                                                       | true                        |\n| $wgWebPEnableConvertOnTransform    | Enables file creation after a thumbnail was created. This isn't necessary if a thumbhandler is active.                                                                    | false                                                                                                                      | true                        |\n| $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                        |\n| $wgWebPCheckAcceptHeader           | Check if the accept header contains webp. If not the original file will be served.                                                                                        | true                                                                                                                       | false                       |\n| $wgWebPCompressionQuality          | Compression Quality. Lower means worse.                                                                                                                                   | 50                                                                                                                         | 75                          |\n| $wgWebPCompressionQualityAvif      | Compression Quality for Avif files. Lower means worse.                                                                                                                    | 50                                                                                                                         | 30                          |\n| $wgWebPFilterStrength              | Alpha compression strength. Sets imagick `webp:alpha-quality` and `cwebp -alpha_q`. Lossless is 100.                                                                      | 50                                                                                                                         | 80                          |\n| $wgWebPAutoFilter                  | Enables the auto filter.  This algorithm will spend additional time optimizing the filtering strength to reach a well-balanced quality.                                   | false                                                                                                                      | true                        |\n| $wgWebPThumbSizes                  | Thumbnail Sizes to create through the maintenance script                                                                                                                  | [2400]                                                                                                                     | [120, 320, 800, 1200, 1600] |\n| $wgEnabledTransformers             | List of enabled image transformers                                                                                                                                        | [ \"MediaWiki\\\\Extension\\\\WebP\\\\Transformer\\\\AvifTransformer\", \"MediaWiki\\\\Extension\\\\WebP\\\\Transformer\\\\WebPTransformer\" ] | WebP Transformer            |\n| $wgWebPCWebPLocation               | Path to `cwebp` executable                                                                                                                                                |                                                                                                                            | /usr/bin/cwebp              |\n| $wgWebPAvifencLocation             | Path to `avifenc` executable                                                                                                                                              |                                                                                                                            | /usr/bin/avifenc            |\n\n### Enabling Avif\nFor full feature support you'll need to install Imagick v7, als v6.9 has multiple bugs.  \nAlternatively you can install `libavif-bin` (\u003e= 0.9.3) which provides `avifenc`. Do note that this still requires _a_ version of imagick installed, as avifenc can't rescale images.  \n\nWhen enabling the Avif transformer, make sure that it is ordered before the webp transformer, as else the browser will pick the webp version.\n\n```php\n$wgEnabledTransformers = [ \"MediaWiki\\\\Extension\\\\WebP\\\\Transformer\\\\AvifTransformer\", \"MediaWiki\\\\Extension\\\\WebP\\\\Transformer\\\\WebPTransformer\" ];\n```\n\n## De-Installation\nDelete the folders `images/webp` and `images/thumbs/webp` and remove the extension.  \nIf the Avif transformer is active remove `images/avif` and `images/thumbs/avif`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctfx%2Fmediawiki-extension-webp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctfx%2Fmediawiki-extension-webp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctfx%2Fmediawiki-extension-webp/lists"}