Open main menu


MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Implementation Media
Description Allows to display tiff-files
Author(s) Hallo Welt! Medienwerkstatt GmbH for Wikimedia Deutschland e. V.
Latest version continuous updates
MediaWiki 1.29+
PHP 5.4+
Database changes No
License GNU General Public License 2.0 or later
Translate the PagedTiffHandler extension if it is available at
Check usage and version matrix.

The PagedTiffHandler extension allows to upload and display tiff-files into your wiki. It can handle multi-paged images and render them into thumbnails on per page basis.


You can embed images using standard image syntax. Additionally, there are two new parameters:

Parameter Example Function
page [[Image:Test.tiff|page=2]] Renders a thumbnail of the second page of test.tiff. Page numbers start with 1. Default value is 1.
lossy [[Image:Test.tiff|lossy=false]] If set to false, thumbnails are being rendered as png, otherwise as jpg. If no value is set, PagedTiffHandler determines the value based on the presence of an alpha channel. If alpha is there, thumbnail is rendered as png. Possible values for jpg: '1', 'true' and 'lossy'. Possible values for png: '0', 'false' and 'lossless'.



Package Description Link
"imagemagick" for identify Does dynamic resizing and thumbnailing of images

Type the following in your shell to see if you have the above installed first:

which identify

Required (optionally)Edit

Package Description Link
"exiv2" for exiv2 Exiv2 is a Cross-platform C++ library and a command line utility to manage image metadata.
"libvips" and "libvips-tools" for vips A fast image processing library with low memory needs.
"libtiff-tools" for tiffinfo Display information about one or more TIFF files.

Type the following in your shell to see if you have the above installed first:

which exiv2 vips tiffinfo


  • Download and place the file(s) in a directory called PagedTiffHandler in your extensions/ folder.

To users running MediaWiki 1.27 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.27 and earlier), instead of wfLoadExtension( 'PagedTiffHandler' );, you need to use:

require_once "$IP/extensions/PagedTiffHandler/PagedTiffHandler.php";


PagedTiffHandler rejects images based on error messages of ImageMagick. There are three options:

  • Images are rejected if the error message matches $wgTiffIdentifyRejectMessages
  • Images are accepted without moaning if the error message matches $wgTiffIdentifyBypassMessages
  • In other cases, images are accepted but the error message is recorded in the image metadata.

Example configuration (all of the parameters show the default configuration):

$wgTiffIdentifyRejectMessages = array(
	'/^identify: Compression algorithm does not support random access/',
	'/^identify: Old-style LZW codes, convert file/',
	'/^identify: Sorry, requested compression method is not configured/',
	'/^identify: ThunderDecode: Not enough data at scanline/',
	'/^identify: .+?: Read error on strip/',
	'/^identify: .+?: Can not read TIFF directory/',
	'/^identify: Not a TIFF/',
$wgTiffIdentifyBypassMessages = array(
	'/^identify: .*TIFFReadDirectory/',
	'/^identify: .+?: unknown field with tag .+? encountered/'

PagedTiffHandler depends on various external programs in order to process Tiff images.

  • ImageMagick is used to check the image and render thumbail images. This is mandatory, PagedTiffHandler will not work without ImageMagick.
  • Exiv2 is used to extract image metadata (optional).
  • Vips is an addition to ImageMagick for fast processing of large image files (optional).

For each software in use, a path to the binary file must be provided.

Example configuration:

// Path to identify
$wgImageMagickIdentifyCommand = '/usr/bin/identify';
// Use exiv2?
$wgTiffUseExiv = false;
// Path to exiv2
$wgTiffExivCommand = '/usr/bin/exiv2';
// Use vips
$wgTiffUseVips = false;
// Path to vips
$wgTiffVipsCommand = '/usr/bin/vips';

PagedTiffHandler also checks a few parameters of the image in order to be able to control the necessary processing time.

Example configuration:

// Maximum number of embedded files in tiff image
$wgTiffMaxEmbedFiles = 10000;
// Maximum size of meta data
$wgTiffMaxMetaSize = 64*1024; // 64kB

When thumbnailing fails for an image, PagedTiffHandler will not try again to render this image for some time. The setting below controls after how many seconds thumbnailing may be tried again.

Example configuration:

// TTL of Cacheentries for Errors
$wgTiffErrorCacheTTL = 84600;

All of the above shown parameters are set as default in the configuration of the extension.

See alsoEdit