r68714 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68713‎ | r68714 | r68715 >
Date:08:40, 29 June 2010
Author:daniel
Status:ok (Comments)
Tags:
Comment:
added normalization for parameter 'page', based on pageCount, as by tims comment to r68418
Modified paths:
  • /trunk/phase3/includes/media/Generic.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/Generic.php
@@ -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 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r68715normalisation of parameter "page" was moved to ImageHandler as of r68714; thi...daniel08:41, 29 June 2010
r71188MFT r68409, r68468, r68469, r68714: supporting revisions for PagedTiffHandler.tstarling02:19, 17 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68418fixed thumbnail parameter handling, as suggested by TimStarling in a comment ...daniel17:40, 22 June 2010

Comments

#Comment by Duesentrieb (talk | contribs)   13:29, 15 July 2010

need this live, so we can deploy PagedTiffHandler

Status & tagging log