r71188 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71187‎ | r71188 | r71189 >
Date:02:19, 17 August 2010
Author:tstarling
Status:deferred
Tags:
Comment:
MFT r68409, r68468, r68469, r68714: supporting revisions for PagedTiffHandler.
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/OggHandler (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/OggHandler/OggHandler_body.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/PdfHandler (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/PdfHandler/PdfHandler_body.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/filerepo (modified) (history)
  • /branches/wmf/1.16wmf4/includes/filerepo/File.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/media (modified) (history)
  • /branches/wmf/1.16wmf4/includes/media/BMP.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/media/Bitmap.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/media/DjVu.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/media/Generic.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/media/SVG.php (modified) (history)
  • /branches/wmf/1.16wmf4/includes/media/Tiff.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/OggHandler/OggHandler_body.php
@@ -169,7 +169,7 @@
170170 return $this->unpackMetadata( $metadata ) !== false;
171171 }
172172
173 - function getThumbType( $ext, $mime ) {
 173+ function getThumbType( $ext, $mime, $params = null ) {
174174 return array( 'jpg', 'image/jpeg' );
175175 }
176176
Property changes on: branches/wmf/1.16wmf4/extensions/OggHandler
___________________________________________________________________
Modified: svn:mergeinfo
177177 Merged /trunk/extensions/OggHandler:r68469
Index: branches/wmf/1.16wmf4/extensions/PdfHandler/PdfHandler_body.php
@@ -173,7 +173,7 @@
174174 return $this->getPdfImage( $image, $path )->getImageSize();
175175 }
176176
177 - function getThumbType( $ext, $mime ) {
 177+ function getThumbType( $ext, $mime, $params = null ) {
178178 global $wgPdfOutputExtension;
179179 static $mime;
180180
Property changes on: branches/wmf/1.16wmf4/extensions/PdfHandler
___________________________________________________________________
Added: svn:mergeinfo
181181 Merged /branches/wmf-deployment/extensions/PdfHandler:r60970
182182 Merged /trunk/extensions/PdfHandler:r68469
183183 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 @@
465465 return null;
466466 }
467467 $extension = $this->getExtension();
468 - list( $thumbExt, $thumbMime ) = $this->handler->getThumbType( $extension, $this->getMimeType() );
 468+ list( $thumbExt, $thumbMime ) = $this->handler->getThumbType( $extension, $this->getMimeType(), $params );
469469 $thumbName = $this->handler->makeParamString( $params ) . '-' . $this->getName();
470470 if ( $thumbExt != $extension ) {
471471 $thumbName .= ".$thumbExt";
Property changes on: branches/wmf/1.16wmf4/includes/filerepo
___________________________________________________________________
Added: svn:mergeinfo
472472 Merged /branches/sqlite/includes/filerepo:r58211-58321
473473 Merged /trunk/phase3/includes/filerepo:r63549,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,68409
474474 Merged /branches/wmf-deployment/includes/filerepo:r53381,60970
475475 Merged /branches/REL1_15/phase3/includes/filerepo:r51646
Property changes on: branches/wmf/1.16wmf4/includes/media/Bitmap.php
___________________________________________________________________
Modified: svn:mergeinfo
476476 Merged /trunk/phase3/includes/media/Bitmap.php:r68409,68468,68714
Index: branches/wmf/1.16wmf4/includes/media/Generic.php
@@ -139,7 +139,7 @@
140140 * Get the thumbnail extension and MIME type for a given source MIME type
141141 * @return array thumbnail extension and MIME type
142142 */
143 - function getThumbType( $ext, $mime ) {
 143+ function getThumbType( $ext, $mime, $params = null ) {
144144 return array( $ext, $mime );
145145 }
146146
@@ -357,9 +357,19 @@
358358 if ( !isset( $params['width'] ) ) {
359359 return false;
360360 }
 361+
361362 if ( !isset( $params['page'] ) ) {
362363 $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+ }
363372 }
 373+
364374 $srcWidth = $image->getWidth( $params['page'] );
365375 $srcHeight = $image->getHeight( $params['page'] );
366376 if ( isset( $params['height'] ) && $params['height'] != -1 ) {
Index: branches/wmf/1.16wmf4/includes/media/BMP.php
@@ -17,7 +17,7 @@
1818 }
1919
2020 // Render files as PNG
21 - function getThumbType( $text, $mime ) {
 21+ function getThumbType( $text, $mime, $params = null ) {
2222 return array( 'png', 'image/png' );
2323 }
2424
Index: branches/wmf/1.16wmf4/includes/media/SVG.php
@@ -106,7 +106,7 @@
107107 return wfGetSVGsize( $path );
108108 }
109109
110 - function getThumbType( $ext, $mime ) {
 110+ function getThumbType( $ext, $mime, $params = null ) {
111111 return array( 'png', 'image/png' );
112112 }
113113
Index: branches/wmf/1.16wmf4/includes/media/DjVu.php
@@ -181,7 +181,7 @@
182182 return $this->getDjVuImage( $image, $path )->getImageSize();
183183 }
184184
185 - function getThumbType( $ext, $mime ) {
 185+ function getThumbType( $ext, $mime, $params = null ) {
186186 global $wgDjvuOutputExtension;
187187 static $mime;
188188 if ( !isset( $mime ) ) {
Index: branches/wmf/1.16wmf4/includes/media/Tiff.php
@@ -26,7 +26,7 @@
2727 return true;
2828 }
2929
30 - function getThumbType( $ext, $mime ) {
 30+ function getThumbType( $ext, $mime, $params = null ) {
3131 global $wgTiffThumbnailType;
3232 return $wgTiffThumbnailType;
3333 }
Property changes on: branches/wmf/1.16wmf4/includes/media
___________________________________________________________________
Modified: svn:mergeinfo
3434 Merged /trunk/phase3/includes/media:r68409,68468,68714

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68409passing thumbnail params to getThumbType, as suggested by TimStarling in a co...daniel16:01, 22 June 2010
r68468Follow-up r68409: shut up PHP Strict Standards notices about "Declaration of ...siebrand18:18, 23 June 2010
r68469Follow-up r68409 for extensions: shut up PHP Strict Standards notices about "...siebrand18:23, 23 June 2010
r68714added normalization for parameter 'page', based on pageCount, as by tims comm...daniel08:40, 29 June 2010

Status & tagging log