http://www.mediawiki.org/wiki/Special:Code/MediaWiki/71785
Revision: 71785
Author: tstarling
Date: 2010-08-27 09:12:24 +0000 (Fri, 27 Aug 2010)
Log Message:
-----------
Support for PagedTiffHandler. Committing for test on server.
Modified Paths:
--------------
trunk/tools/upload-scripts/thumb-handler.php
Modified: trunk/tools/upload-scripts/thumb-handler.php
===================================================================
--- trunk/tools/upload-scripts/thumb-handler.php 2010-08-27 09:02:54 UTC
(rev 71784)
+++ trunk/tools/upload-scripts/thumb-handler.php 2010-08-27 09:12:24 UTC
(rev 71785)
@@ -25,9 +25,11 @@
if ( $arch ) {
$params['archived'] = 1;
}
-} elseif (
preg_match('!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|)/\w/\w\w/([^/]*\.(?:(?i)ogg|ogv|oga))/'
.
+} elseif (
preg_match('!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|)/'
.
+ '\w/\w\w/([^/]*\.(?:(?i)ogg|ogv|oga))/' .
'(mid|seek(?:=|%3D|%3d)[0-9.]+)-([^/]*)$!', $uri, $matches ) )
{
+ # OggHandler
list( $all, $site, $lang, $arch, $filename, $timeFull, $fn2 ) =
$matches;
$params = array( 'f' => $filename );
if ( $timeFull != 'mid' ) {
@@ -37,6 +39,21 @@
if ( $arch ) {
$params['archived'] = 1;
}
+} elseif ( preg_match(
'!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|)/' .
+ '\w/\w\w/([^/]*\.(?:(?i)tiff|tif))/' .
+ '(lossy|lossless)-page(\d+)-(\d+)px-([^/]*)$!', $uri, $matches ) )
+{
+ # PagedTiffHandler
+ list( $all, $site, $lang, $arch, $filename, $lossy, $pagenum, $size,
$fn2 ) = $matches;
+ $params = array(
+ 'f' => $filename,
+ 'lossy' => $lossy
+ 'width' => $size,
+ 'page' => $pagenum,
+ );
+ if ( $arch ) {
+ $params['archived'] = 1;
+ }
} else {
# No, display standard 404
header( 'X-Debug: no regex match' );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs