Index: trunk/phase3/includes/specials/SpecialFilepath.php |
— | — | @@ -47,7 +47,16 @@ |
48 | 48 | } else { |
49 | 49 | $file = wfFindFile( $title ); |
50 | 50 | if ( $file && $file->exists() ) { |
51 | | - $wgOut->redirect( $file->getURL() ); |
| 51 | + $url = $file->getURL(); |
| 52 | + $width = $wgRequest->getInt( 'width', -1 ); |
| 53 | + $height = $wgRequest->getInt( 'height', -1 ); |
| 54 | + if ( $width != -1 ) { |
| 55 | + $mto = $file->transform( array( 'width' => $width, 'height' => $height ) ); |
| 56 | + if ( $mto && !$mto->isError() ) { |
| 57 | + $url = $mto->getURL(); |
| 58 | + } |
| 59 | + } |
| 60 | + $wgOut->redirect( $url ); |
52 | 61 | } else { |
53 | 62 | $wgOut->setStatusCode( 404 ); |
54 | 63 | $this->showForm( $title ); |