summaryrefslogtreecommitdiff
path: root/includes/media
diff options
context:
space:
mode:
Diffstat (limited to 'includes/media')
-rw-r--r--includes/media/Bitmap.php4
-rw-r--r--includes/media/Tiff.php33
2 files changed, 36 insertions, 1 deletions
diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php
index b949ae3d..c2f2458e 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -42,7 +42,7 @@ class BitmapHandler extends ImageHandler {
function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
global $wgUseImageMagick, $wgImageMagickConvertCommand, $wgImageMagickTempDir;
- global $wgCustomConvertCommand;
+ global $wgCustomConvertCommand, $wgUseImageResize;
global $wgSharpenParameter, $wgSharpenReductionThreshold;
global $wgMaxAnimatedGifArea;
@@ -69,6 +69,8 @@ class BitmapHandler extends ImageHandler {
if ( !$dstPath ) {
// No output path available, client side scaling only
$scaler = 'client';
+ } elseif( !$wgUseImageResize ) {
+ $scaler = 'client';
} elseif ( $wgUseImageMagick ) {
$scaler = 'im';
} elseif ( $wgCustomConvertCommand ) {
diff --git a/includes/media/Tiff.php b/includes/media/Tiff.php
new file mode 100644
index 00000000..9d3fbb78
--- /dev/null
+++ b/includes/media/Tiff.php
@@ -0,0 +1,33 @@
+<?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;
+ }
+}