Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -141,6 +141,10 @@ |
142 | 142 | * (bug 4582) Provide preference-based autoformatting of unlinked dates with the dateformat |
143 | 143 | parser function. |
144 | 144 | * (bug 17886) Special:Export now allows you to export a whole namespace (limited to 5000 pages) |
| 145 | +* (bug 17714) Limited TIFF upload support now built in if 'tif' extension is |
| 146 | + enabled. Image width and height are now recognized, and when using ImageMagick, |
| 147 | + optional flattening to PNG or JPEG for inline display can be enabled by setting |
| 148 | + $wgTiffThumbnailType |
145 | 149 | |
146 | 150 | === Bug fixes in 1.15 === |
147 | 151 | * (bug 16968) Special:Upload no longer throws useless warnings. |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -189,6 +189,7 @@ |
190 | 190 | 'StringUtils' => 'includes/StringUtils.php', |
191 | 191 | 'TablePager' => 'includes/Pager.php', |
192 | 192 | 'ThumbnailImage' => 'includes/MediaTransformOutput.php', |
| 193 | + 'TiffHandler' => 'includes/media/Tiff.php', |
193 | 194 | 'TitleDependency' => 'includes/CacheDependency.php', |
194 | 195 | 'Title' => 'includes/Title.php', |
195 | 196 | 'TitleArray' => 'includes/TitleArray.php', |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1997,6 +1997,7 @@ |
1998 | 1998 | 'image/jpeg' => 'BitmapHandler', |
1999 | 1999 | 'image/png' => 'BitmapHandler', |
2000 | 2000 | 'image/gif' => 'BitmapHandler', |
| 2001 | + 'image/tiff' => 'TiffHandler', |
2001 | 2002 | 'image/x-ms-bmp' => 'BmpHandler', |
2002 | 2003 | 'image/x-bmp' => 'BmpHandler', |
2003 | 2004 | 'image/svg+xml' => 'SvgHandler', // official |
— | — | @@ -2075,6 +2076,16 @@ |
2076 | 2077 | */ |
2077 | 2078 | $wgMaxAnimatedGifArea = 1.0e6; |
2078 | 2079 | /** |
| 2080 | + * Browsers don't support TIFF inline generally... |
| 2081 | + * For inline display, we need to convert to PNG or JPEG. |
| 2082 | + * Note scaling should work with ImageMagick, but may not with GD scaling. |
| 2083 | + * // PNG is lossless, but inefficient for photos |
| 2084 | + * $wgTiffThumbnailType = array( 'png', 'image/png' ); |
| 2085 | + * // JPEG is good for photos, but has no transparency support. Bad for diagrams. |
| 2086 | + * $wgTiffThumbnailType = array( 'jpg', 'image/jpeg' ); |
| 2087 | + */ |
| 2088 | +$wgTiffThumbnailType = false; |
| 2089 | +/** |
2079 | 2090 | * If rendered thumbnail files are older than this timestamp, they |
2080 | 2091 | * will be rerendered on demand as if the file didn't already exist. |
2081 | 2092 | * Update if there is some need to force thumbs and SVG rasterizations |
Index: trunk/phase3/includes/media/Tiff.php |
— | — | @@ -0,0 +1,33 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * @file |
| 5 | + * @ingroup Media |
| 6 | + */ |
| 7 | + |
| 8 | +/** |
| 9 | + * @ingroup Media |
| 10 | + */ |
| 11 | +class TiffHandler extends BitmapHandler { |
| 12 | + |
| 13 | + /** |
| 14 | + * Conversion to PNG for inline display can be disabled here... |
| 15 | + * Note scaling should work with ImageMagick, but may not with GD scaling. |
| 16 | + */ |
| 17 | + function canRender( $file ) { |
| 18 | + global $wgTiffThumbnailType; |
| 19 | + return (bool)$wgTiffThumbnailType; |
| 20 | + } |
| 21 | + |
| 22 | + /** |
| 23 | + * Browsers don't support TIFF inline generally... |
| 24 | + * For inline display, we need to convert to PNG. |
| 25 | + */ |
| 26 | + function mustRender( $file ) { |
| 27 | + return true; |
| 28 | + } |
| 29 | + |
| 30 | + function getThumbType( $ext, $mime ) { |
| 31 | + global $wgTiffThumbnailType; |
| 32 | + return $wgTiffThumbnailType; |
| 33 | + } |
| 34 | +} |
Property changes on: trunk/phase3/includes/media/Tiff.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 35 | + native |