Extension:APNG

From MediaWiki.org
Jump to navigation Jump to search

Other languages:
Deutsch • ‎English • ‎français • ‎polski • ‎中文 • ‎日本語
MediaWiki extensions manual
Crystal Clear action run.svg
APNG
Release status: beta
Implementation Media
Description Enables animated PNG support in unsupported browsers, based on apng-canvas library.
Author(s) Mudkip metalk
Latest version 0.2.0 (2018-01-07)
MediaWiki 1.25+
PHP 5.3+
Database changes No
License MIT License
Download
README
Example http://wiki.52poke.com/wiki/七賢人
Hooks used
ImageBeforeProduceHTML
BeforePageDisplay
Translate the APNG extension if it is available at translatewiki.net
Check usage and version matrix.

The APNG extension enables animated PNG support in unsupported browsers.

Currently, the only modern browser without APNG support is Microsoft Edge. This extension works on all modern browsers and IE starting with version 10.

APNG extension is based on David Mzareulyan's apng-canvas library.

Installation[edit]

  • Download and place the file(s) in a directory called APNG in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/APNG/APNG.php";
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Limitation[edit]

If you use a different domain for your $wgUploadPath, the web server is required to send a Access-Control-Allow-Origin: * header for PNG files.

For example, you can simply add the following lines to the location scope of your Nginx configuration:

    if ($request_uri ~* \.png$) {
        add_header Access-Control-Allow-Origin *;
    }