enabled. Image width and height are now recognized, and when using ImageMagick, optional flattening to PNG or JPEG for inline display can be enabled by setting $wgTiffThumbnailType By default no thumbnailing will occur; only difference from previous will be that the image width/height is detected and displayed. Not yet implemented: * Multi-page support * Cleverer thumbnailing for giant files * Thumbnailing of any sort if not using ImageMagick
33 lines
636 B
PHP
33 lines
636 B
PHP
<?php
|
|
/**
|
|
* @file
|
|
* @ingroup Media
|
|
*/
|
|
|
|
/**
|
|
* @ingroup Media
|
|
*/
|
|
class TiffHandler extends BitmapHandler {
|
|
|
|
/**
|
|
* Conversion to PNG for inline display can be disabled here...
|
|
* Note scaling should work with ImageMagick, but may not with GD scaling.
|
|
*/
|
|
function canRender( $file ) {
|
|
global $wgTiffThumbnailType;
|
|
return (bool)$wgTiffThumbnailType;
|
|
}
|
|
|
|
/**
|
|
* Browsers don't support TIFF inline generally...
|
|
* For inline display, we need to convert to PNG.
|
|
*/
|
|
function mustRender( $file ) {
|
|
return true;
|
|
}
|
|
|
|
function getThumbType( $ext, $mime ) {
|
|
global $wgTiffThumbnailType;
|
|
return $wgTiffThumbnailType;
|
|
}
|
|
}
|