r115400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r115399‎ | r115400 | r115401 >
Date:21:29, 18 May 2012
Author:ashley
Status:new
Tags:
Comment:
update social tools not to call File::getThumbnail(), which was removed in r87349. Based on http://trac.wikia-code.com/changeset/53285 written by Federico 'Lox' Lucignano
Modified paths:
  • /trunk/extensions/BlogPage/SpecialArticleLists.php (modified) (history)
  • /trunk/extensions/BlogPage/SpecialArticlesHome.php (modified) (history)
  • /trunk/extensions/FanBoxes/MiniAjaxUpload.php (modified) (history)
  • /trunk/extensions/PictureGame/AjaxUploadForm.php (modified) (history)
  • /trunk/extensions/PictureGame/PictureGameHome.body.php (modified) (history)
  • /trunk/extensions/PollNY/MiniAjaxUpload.php (modified) (history)
  • /trunk/extensions/QuizGame/QuestionGameHome.body.php (modified) (history)
  • /trunk/extensions/QuizGame/QuestionGameUpload.php (modified) (history)
  • /trunk/extensions/RandomImageByCategory/RandomImageByCategory.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
@@ -440,13 +440,13 @@
441441 $image_1 = $image_2 = '';
442442 $render_1 = wfFindFile( $item['img1'] );
443443 if ( is_object( $render_1 ) ) {
444 - $thumb_1 = $render_1->getThumbnail( 25 );
 444+ $thumb_1 = $render_1->transform( array( 'width' => 25 ) );
445445 $image_1 = $thumb_1->toHtml();
446446 }
447447
448448 $render_2 = wfFindFile( $item['img2'] );
449449 if ( is_object( $render_2 ) ) {
450 - $thumb_2 = $render_2->getThumbnail( 25 );
 450+ $thumb_2 = $render_2->transform( array( 'width' => 25 ) );
451451 $image_2 = $thumb_2->toHtml();
452452 }
453453
Index: trunk/extensions/QuizGame/QuestionGameHome.body.php
@@ -314,7 +314,7 @@
315315 // You know why this check is here, just grep for the function
316316 // name (I'm too lazy to copypaste it here for the third time).
317317 if ( is_object( $image ) ) {
318 - $thumb = $image->getThumbnail( 80, 0, true );
 318+ $thumb = $image->transform( array( 'width' => 80, 'height' => 0 ) );
319319 $thumbnail = $thumb->toHtml();
320320 }
321321 }
@@ -568,7 +568,7 @@
569569 // independently deleted from the quiz game, poor users will
570570 // stumble upon nasty fatals without this check here.
571571 if ( is_object( $image ) ) {
572 - $thumb = $image->getThumbnail( 80 );
 572+ $thumb = $image->transform( array( 'width' => 80 ) );
573573 $thumbtag = $thumb->toHtml();
574574 }
575575
Index: trunk/extensions/QuizGame/QuestionGameUpload.php
@@ -296,7 +296,7 @@
297297 $img = $this->mLocalFile;
298298
299299 if ( !$img ) {
300 - // This should NOT be happening...the getThumbnail() call below
 300+ // This should NOT be happening...the transform() call below
301301 // will cause a fatal error if $img is not an object
302302 error_log(
303303 'QuizGame/MiniAjaxUpload FATAL! $this->mUpload is: ' .
@@ -304,7 +304,7 @@
305305 );
306306 }
307307
308 - $thumb = $img->getThumbnail( $thumbWidth );
 308+ $thumb = $img->transform( array( 'width' => $thumbWidth ) );
309309 $img_tag = $thumb->toHtml();
310310 $slashedImgTag = addslashes( $img_tag );
311311
Index: trunk/extensions/PictureGame/PictureGameHome.body.php
@@ -476,13 +476,13 @@
477477 $img_one_tag = $img_two_tag = '';
478478 $img_one = wfFindFile( $row->img1 );
479479 if ( is_object( $img_one ) ) {
480 - $thumb_one = $img_one->getThumbnail( 128 );
 480+ $thumb_one = $img_one->transform( array( 'width' => 128 ) );
481481 $img_one_tag = $thumb_one->toHtml();
482482 }
483483
484484 $img_two = wfFindFile( $row->img2 );
485485 if ( is_object( $img_two ) ) {
486 - $thumb_two = $img_two->getThumbnail( 128 );
 486+ $thumb_two = $img_two->transform( array( 'width' => 128 ) );
487487 $img_two_tag = $thumb_two->toHtml();
488488 }
489489
@@ -536,13 +536,13 @@
537537 $img_one_tag = $img_two_tag = '';
538538 $img_one = wfFindFile( $row->img1 );
539539 if ( is_object( $img_one ) ) {
540 - $thumb_one = $img_one->getThumbnail( 128 );
 540+ $thumb_one = $img_one->transform( array( 'width' => 128 ) );
541541 $img_one_tag = $thumb_one->toHtml();
542542 }
543543
544544 $img_two = wfFindFile( $row->img2 );
545545 if ( is_object( $img_two ) ) {
546 - $thumb_two = $img_two->getThumbnail( 128 );
 546+ $thumb_two = $img_two->transform( array( 'width' => 128 ) );
547547 $img_two_tag = $thumb_two->toHtml();
548548 }
549549
@@ -865,13 +865,13 @@
866866 $gallery_thumbnail_one = $gallery_thumbnail_two = '';
867867 $img_one = wfFindFile( $row->img1 );
868868 if ( is_object( $img_one ) ) {
869 - $gallery_thumb_image_one = $img_one->getThumbnail( 80 );
 869+ $gallery_thumb_image_one = $img_one->transform( array( 'width' => 80 ) );
870870 $gallery_thumbnail_one = $gallery_thumb_image_one->toHtml();
871871 }
872872
873873 $img_two = wfFindFile( $row->img2 );
874874 if ( is_object( $img_two ) ) {
875 - $gallery_thumb_image_two = $img_two->getThumbnail( 80 );
 875+ $gallery_thumb_image_two = $img_two->transform( array( 'width' => 80 ) );
876876 $gallery_thumbnail_two = $gallery_thumb_image_two->toHtml();
877877 }
878878
@@ -1151,7 +1151,7 @@
11521152 if( $next_id ) {
11531153 $img_one = wfFindFile( $nextrow->img1 );
11541154 if( is_object( $img_one ) ) {
1155 - $preload_thumb = $img_one->getThumbnail( 256 );
 1155+ $preload_thumb = $img_one->transform( array( 'width' => 256 ) );
11561156 }
11571157 if( is_object( $preload_thumb ) ) {
11581158 $preload_one_tag = $preload_thumb->toHtml();
@@ -1159,7 +1159,7 @@
11601160
11611161 $img_two = wfFindFile( $nextrow->img2 );
11621162 if( is_object( $img_two ) ) {
1163 - $preload_thumb = $img_two->getThumbnail( 256 );
 1163+ $preload_thumb = $img_two->transform( array( 'width' => 256 ) );
11641164 }
11651165 if( is_object( $preload_thumb ) ) {
11661166 $preload_two_tag = $preload_thumb->toHtml();
@@ -1295,14 +1295,14 @@
12961296
12971297 if( $isPermalink || $isShowVotes ) {
12981298 if( is_object( $img_one ) ) {
1299 - $vote_one_thumb = $img_one->getThumbnail( 40 );
 1299+ $vote_one_thumb = $img_one->transform( array( 'width' => 40 ) );
13001300 }
13011301 if( is_object( $vote_one_thumb ) ) {
13021302 $vote_one_tag = $vote_one_thumb->toHtml();
13031303 }
13041304
13051305 if( is_object( $img_two ) ) {
1306 - $vote_two_thumb = $img_two->getThumbnail( 40 );
 1306+ $vote_two_thumb = $img_two->transform( array( 'width' => 40 ) );
13071307 }
13081308 if( is_object( $vote_two_thumb ) ) {
13091309 $vote_two_tag = $vote_two_thumb->toHtml();
Index: trunk/extensions/PictureGame/AjaxUploadForm.php
@@ -294,7 +294,7 @@
295295 $img = $this->mLocalFile;
296296
297297 if ( !$img ) {
298 - // This should NOT be happening...the getThumbnail() call below
 298+ // This should NOT be happening...the transform() call below
299299 // will cause a fatal error if $img is not an object
300300 error_log(
301301 'PictureGame/MiniAjaxUpload FATAL! $this->mUpload is: ' .
@@ -302,7 +302,7 @@
303303 );
304304 }
305305
306 - $thumb = $img->getThumbnail( $thumbWidth );
 306+ $thumb = $img->transform( array( 'width' => $thumbWidth ) );
307307 $img_tag = $thumb->toHtml();
308308 $slashedImgTag = addslashes( $img_tag );
309309
Index: trunk/extensions/PollNY/MiniAjaxUpload.php
@@ -281,7 +281,7 @@
282282 $img = $this->mLocalFile;
283283
284284 if ( !$img ) {
285 - // This should NOT be happening...the getThumbnail() call below
 285+ // This should NOT be happening...the transform() call below
286286 // will cause a fatal error if $img is not an object
287287 error_log(
288288 'PollNY/MiniAjaxUpload FATAL! $this->mUpload is: ' .
@@ -289,7 +289,7 @@
290290 );
291291 }
292292
293 - $thumb = $img->getThumbnail( $thumbWidth );
 293+ $thumb = $img->transform( array( 'width' => $thumbWidth ) );
294294 $img_tag = $thumb->toHtml();
295295 $slashedImgTag = addslashes( $img_tag );
296296
Index: trunk/extensions/BlogPage/SpecialArticlesHome.php
@@ -210,7 +210,7 @@
211211 $img = wfFindFile( $pageImage );
212212 $imgTag = '';
213213 if ( is_object( $img ) ) {
214 - $thumb = $img->getThumbnail( 65, 0, true );
 214+ $thumb = $img->transform( array( 'width' => 65, 'height' => 0 ) );
215215 $imgTag = $thumb->toHtml();
216216 }
217217
@@ -578,7 +578,7 @@
579579 $img = wfFindFile( $pageImage );
580580 $imgTag = '';
581581 if ( is_object( $img ) ) {
582 - $thumb = $img->getThumbnail( 65, 0, true );
 582+ $thumb = $img->transform( array( 'width' => 65, 'height' => 0 ) );
583583 $imgTag = $thumb->toHtml();
584584 }
585585
Index: trunk/extensions/BlogPage/SpecialArticleLists.php
@@ -92,7 +92,7 @@
9393 $img = wfFindFile( $pageImage );
9494 $imgTag = '';
9595 if ( is_object( $img ) ) {
96 - $thumb = $img->getThumbnail( 65, 0, true );
 96+ $thumb = $img->transform( array( 'width' => 65, 'height' => 0 ) );
9797 $imgTag = $thumb->toHtml();
9898 }
9999
Index: trunk/extensions/RandomImageByCategory/RandomImageByCategory.php
@@ -110,7 +110,7 @@
111111 $image_title = Title::makeTitle( NS_FILE, $random_image );
112112 $render_image = wfFindFile( $random_image );
113113
114 - $thumb_image = $render_image->getThumbnail( $width );
 114+ $thumb_image = $render_image->transform( array( 'width' => $width ) );
115115 $thumbnail = "<a href=\"{$image_title->escapeFullURL()}\">{$thumb_image->toHtml()}</a>";
116116 }
117117
Index: trunk/extensions/FanBoxes/MiniAjaxUpload.php
@@ -279,7 +279,7 @@
280280 $img = $this->mLocalFile;
281281
282282 if ( !$img ) {
283 - // This should NOT be happening...the getThumbnail() call below
 283+ // This should NOT be happening...the transform() call below
284284 // will cause a fatal error if $img is not an object
285285 error_log(
286286 'FanBox/MiniAjaxUpload FATAL! $this->mUpload is:' .
@@ -287,7 +287,7 @@
288288 );
289289 }
290290
291 - $thumb = $img->getThumbnail( $thumbWidth );
 291+ $thumb = $img->transform( array( 'width' => $thumbWidth ) );
292292 $img_tag = $thumb->toHtml();
293293 $slashedImgTag = addslashes( $img_tag );
294294

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87349Only one extension was using getThumbnailnelson19:55, 3 May 2011