Index: branches/wmf/1.16wmf4/extensions/OggHandler/OggHandler_body.php |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | return $this->unpackMetadata( $metadata ) !== false; |
171 | 171 | } |
172 | 172 | |
173 | | - function getThumbType( $ext, $mime ) { |
| 173 | + function getThumbType( $ext, $mime, $params = null ) { |
174 | 174 | return array( 'jpg', 'image/jpeg' ); |
175 | 175 | } |
176 | 176 | |
Property changes on: branches/wmf/1.16wmf4/extensions/OggHandler |
___________________________________________________________________ |
Modified: svn:mergeinfo |
177 | 177 | Merged /trunk/extensions/OggHandler:r68469 |
Index: branches/wmf/1.16wmf4/extensions/PdfHandler/PdfHandler_body.php |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | return $this->getPdfImage( $image, $path )->getImageSize(); |
175 | 175 | } |
176 | 176 | |
177 | | - function getThumbType( $ext, $mime ) { |
| 177 | + function getThumbType( $ext, $mime, $params = null ) { |
178 | 178 | global $wgPdfOutputExtension; |
179 | 179 | static $mime; |
180 | 180 | |
Property changes on: branches/wmf/1.16wmf4/extensions/PdfHandler |
___________________________________________________________________ |
Added: svn:mergeinfo |
181 | 181 | Merged /branches/wmf-deployment/extensions/PdfHandler:r60970 |
182 | 182 | Merged /trunk/extensions/PdfHandler:r68469 |
183 | 183 | Merged /trunk/phase3/extensions/PdfHandler:r63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816 |
Index: branches/wmf/1.16wmf4/includes/filerepo/File.php |
— | — | @@ -464,7 +464,7 @@ |
465 | 465 | return null; |
466 | 466 | } |
467 | 467 | $extension = $this->getExtension(); |
468 | | - list( $thumbExt, $thumbMime ) = $this->handler->getThumbType( $extension, $this->getMimeType() ); |
| 468 | + list( $thumbExt, $thumbMime ) = $this->handler->getThumbType( $extension, $this->getMimeType(), $params ); |
469 | 469 | $thumbName = $this->handler->makeParamString( $params ) . '-' . $this->getName(); |
470 | 470 | if ( $thumbExt != $extension ) { |
471 | 471 | $thumbName .= ".$thumbExt"; |
Property changes on: branches/wmf/1.16wmf4/includes/filerepo |
___________________________________________________________________ |
Added: svn:mergeinfo |
472 | 472 | Merged /branches/sqlite/includes/filerepo:r58211-58321 |
473 | 473 | Merged /trunk/phase3/includes/filerepo:r63549,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,68409 |
474 | 474 | Merged /branches/wmf-deployment/includes/filerepo:r53381,60970 |
475 | 475 | Merged /branches/REL1_15/phase3/includes/filerepo:r51646 |
Property changes on: branches/wmf/1.16wmf4/includes/media/Bitmap.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
476 | 476 | Merged /trunk/phase3/includes/media/Bitmap.php:r68409,68468,68714 |
Index: branches/wmf/1.16wmf4/includes/media/Generic.php |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | * Get the thumbnail extension and MIME type for a given source MIME type |
141 | 141 | * @return array thumbnail extension and MIME type |
142 | 142 | */ |
143 | | - function getThumbType( $ext, $mime ) { |
| 143 | + function getThumbType( $ext, $mime, $params = null ) { |
144 | 144 | return array( $ext, $mime ); |
145 | 145 | } |
146 | 146 | |
— | — | @@ -357,9 +357,19 @@ |
358 | 358 | if ( !isset( $params['width'] ) ) { |
359 | 359 | return false; |
360 | 360 | } |
| 361 | + |
361 | 362 | if ( !isset( $params['page'] ) ) { |
362 | 363 | $params['page'] = 1; |
| 364 | + } else { |
| 365 | + if ( $params['page'] > $image->pageCount() ) { |
| 366 | + $params['page'] = $image->pageCount(); |
| 367 | + } |
| 368 | + |
| 369 | + if ( $params['page'] < 1 ) { |
| 370 | + $params['page'] = 1; |
| 371 | + } |
363 | 372 | } |
| 373 | + |
364 | 374 | $srcWidth = $image->getWidth( $params['page'] ); |
365 | 375 | $srcHeight = $image->getHeight( $params['page'] ); |
366 | 376 | if ( isset( $params['height'] ) && $params['height'] != -1 ) { |
Index: branches/wmf/1.16wmf4/includes/media/BMP.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | } |
19 | 19 | |
20 | 20 | // Render files as PNG |
21 | | - function getThumbType( $text, $mime ) { |
| 21 | + function getThumbType( $text, $mime, $params = null ) { |
22 | 22 | return array( 'png', 'image/png' ); |
23 | 23 | } |
24 | 24 | |
Index: branches/wmf/1.16wmf4/includes/media/SVG.php |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | return wfGetSVGsize( $path ); |
108 | 108 | } |
109 | 109 | |
110 | | - function getThumbType( $ext, $mime ) { |
| 110 | + function getThumbType( $ext, $mime, $params = null ) { |
111 | 111 | return array( 'png', 'image/png' ); |
112 | 112 | } |
113 | 113 | |
Index: branches/wmf/1.16wmf4/includes/media/DjVu.php |
— | — | @@ -181,7 +181,7 @@ |
182 | 182 | return $this->getDjVuImage( $image, $path )->getImageSize(); |
183 | 183 | } |
184 | 184 | |
185 | | - function getThumbType( $ext, $mime ) { |
| 185 | + function getThumbType( $ext, $mime, $params = null ) { |
186 | 186 | global $wgDjvuOutputExtension; |
187 | 187 | static $mime; |
188 | 188 | if ( !isset( $mime ) ) { |
Index: branches/wmf/1.16wmf4/includes/media/Tiff.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | return true; |
28 | 28 | } |
29 | 29 | |
30 | | - function getThumbType( $ext, $mime ) { |
| 30 | + function getThumbType( $ext, $mime, $params = null ) { |
31 | 31 | global $wgTiffThumbnailType; |
32 | 32 | return $wgTiffThumbnailType; |
33 | 33 | } |
Property changes on: branches/wmf/1.16wmf4/includes/media |
___________________________________________________________________ |
Modified: svn:mergeinfo |
34 | 34 | Merged /trunk/phase3/includes/media:r68409,68468,68714 |