r87351 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87350‎ | r87351 | r87352 >
Date:20:05, 3 May 2011
Author:nelson
Status:resolved (Comments)
Tags:
Comment:
Only one extension was using getThumbnail
Modified paths:
  • /trunk/extensions/DumpHTML/README (modified) (history)
  • /trunk/extensions/ImageTagging/ImageTagPage.php (modified) (history)
  • /trunk/extensions/ImageTagging/ImageTagging_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DumpHTML/README
@@ -1 +1,5 @@
2 -Work in progress on a replacement for maintenance/dumpHTML.php, to work with MW 1.11+.
 2+Dumps out the HTML for the Wiki. Includes the actual URL of the image (which
 3+is ordinarily searched-for among the configured Repos).
 4+
 5+Was originally maintenance/dumpHTML.php, but was moved into an extension.
 6+
Index: trunk/extensions/ImageTagging/ImageTagging_body.php
@@ -270,7 +270,8 @@
271271 '';
272272
273273 $s .= ( $i%4 == 0 ) ? '<tr>' : '';
274 - $thumb = $img->getThumbnail( 120, 120 );
 274+ $thumb = $img->transform(array( 'width' => 120, 'height' => 120 ) , 0 );
 275+
275276 $vpad = floor( ( 150 - $thumb->height ) /2 ) - 2;
276277 $s .= '<td><div class="gallerybox">' . '<div class="thumb" style="padding: ' . $vpad . 'px 0;">';
277278
Index: trunk/extensions/ImageTagging/ImageTagPage.php
@@ -95,7 +95,8 @@
9696 # because of rounding.
9797 }
9898
99 - $thumbnail = $this->getFile()->getThumbnail( $width );
 99+ $thumbnail = $this->getFile()->transform(array( 'width' => $width ) , 0 );
 100+
100101 if ( $thumbnail == null ) {
101102 $url = $this->getFile()->getViewURL();
102103 } else {
@@ -259,4 +260,4 @@
260261
261262 return $r;
262263 }
263 -}
\ No newline at end of file
 264+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r87432fix whitespace: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/87351nelson18:41, 4 May 2011

Past revisions this follows-up on

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

Comments

#Comment by Reedy (talk | contribs)   20:12, 3 May 2011

You're mixing tabs and spaces

#Comment by RussNelson (talk | contribs)   21:23, 3 May 2011

Argh, yeah. I put in tabs, which vim then ``helpfully converted to spaces ... but just on that one line. I have to figure out how to convince it to only smash tabs when I'm editing a .py file.

Status & tagging log