r81205 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81204‎ | r81205 | r81206 >
Date:08:11, 30 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Like r81204, fixup other usages of getThumbnail in extensions (One extension, Nuke, is one we care about...)
Modified paths:
  • /trunk/extensions/MassBlank/MassBlank_body.php (modified) (history)
  • /trunk/extensions/News/NewsRenderer.php (modified) (history)
  • /trunk/extensions/Nuke/Nuke_body.php (modified) (history)
  • /trunk/extensions/Player/PlayerClass.php (modified) (history)
  • /trunk/extensions/SmoothGallery/SmoothGalleryParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SmoothGallery/SmoothGalleryParser.php
@@ -205,7 +205,8 @@
206206
207207 // Create a thumbnail the same size as our gallery so that
208208 // full images fit correctly
209 - $full_thumb_obj = $img_obj->getThumbnail( $this->argumentArray["width"], $this->argumentArray["height"] );
 209+
 210+ $full_thumb_obj = $img_obj->transform( array( 'width' => $this->argumentArray["width"], 'height' => $this->argumentArray["height"] ), 0 );
210211 if ( !is_null( $full_thumb_obj ) ) {
211212 $full_thumb = $full_thumb_obj->getUrl();
212213 } else {
@@ -225,7 +226,7 @@
226227 // We are going to show a carousel to the user; we need
227228 // to make icon thumbnails
228229 // $thumb_obj = $img_obj->getThumbnail( 120, 120 ); //would be nice to reuse images already loaded...
229 - $thumb_obj = $img_obj->getThumbnail( $wgSmoothGalleryThumbWidth, $wgSmoothGalleryThumbHeight );
 230+ $thumb_obj = $img_obj->transform( array( 'width' => $wgSmoothGalleryThumbWidth, 'height' => $wgSmoothGalleryThumbHeight ), 0 );
230231 if ( $thumb_obj ) {
231232 $icon_thumb = $thumb_obj->getUrl();
232233 }
Index: trunk/extensions/MassBlank/MassBlank_body.php
@@ -94,7 +94,7 @@
9595 foreach( $pages as $info ) {
9696 list( $title, $edits ) = $info;
9797 $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
98 - $thumb = $image && $image->exists() ? $image->getThumbnail( 120, 120 ) : false;
 98+ $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false;
9999
100100 $changes = wfMsgExt( 'nchanges', 'parsemag', $wgLang->formatNum( $edits ) );
101101
Index: trunk/extensions/News/NewsRenderer.php
@@ -640,7 +640,7 @@
641641 $image = false;
642642 }
643643
644 - $thumb = $image ? $image->getThumbnail(80, 16) : null;
 644+ $thumb = $image ? $image->transform( array( 'width' => 80, 'height' => 16 ), 0 ) : null;
645645 if ($image && !$thumb) $thumb = $image;
646646 $iconurl = $thumb ? $thumb->getUrl() : null;
647647
Index: trunk/extensions/Nuke/Nuke_body.php
@@ -133,7 +133,7 @@
134134 foreach( $pages as $info ) {
135135 list( $title, $edits ) = $info;
136136 $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
137 - $thumb = $image && $image->exists() ? $image->getThumbnail( 120, 120 ) : false;
 137+ $thumb = $image && $image->exists() ? $image->transform( array( 'width' => 120, 'height' => 120 ), 0 ) : false;
138138
139139 $changes = wfMsgExt( 'nchanges', 'parsemag', $wgLang->formatNum( $edits ) );
140140
Index: trunk/extensions/Player/PlayerClass.php
@@ -383,7 +383,8 @@
384384 if ($thumbname) $thumbimg = wfFindFile( $thumbname );
385385
386386 if ($thumbimg && $thumbimg->exists()) {
387 - $tni = $thumbimg->getThumbnail( $this->width, $this->height );
 387+
 388+ $tni = $thumbimg->transform( array( 'width' => $this->width, 'height' => $this->height ), 0 );
388389 if ($tni) $thumbstyle = 'background-image:url('.$tni->getUrl().'); background-position:center; background-repeat:no-repeat; text-decoration:none;';
389390 }
390391

Follow-up revisions

RevisionCommit summaryAuthorDate
r813941.17: MFT r81026, r81116, r81155, r81201, r81204, r81205, r81220, r81235, r81...catrope15:33, 2 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81204Fixup usage of $file->getThumbnail as it's deprecated...reedy08:06, 30 January 2011

Status & tagging log