r67611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67610‎ | r67611 | r67612 >
Date:12:15, 8 June 2010
Author:reedy
Status:ok
Tags:
Comment:
* (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when thumbnailing larger than original image

Minor comment casing tweak in File.php
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/File.php
@@ -1054,7 +1054,7 @@
10551055 }
10561056
10571057 /**
1058 - * Get an image size array like that returned by getimagesize(), or false if it
 1058+ * Get an image size array like that returned by getImageSize(), or false if it
10591059 * can't be determined.
10601060 *
10611061 * @param $fileName String: The filename
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -212,8 +212,16 @@
213213 $mto = $file->transform( array( 'width' => $scale['width'], 'height' => $scale['height'] ) );
214214 if ( $mto && !$mto->isError() ) {
215215 $vals['thumburl'] = wfExpandUrl( $mto->getUrl() );
216 - $vals['thumbwidth'] = intval( $mto->getWidth() );
217 - $vals['thumbheight'] = intval( $mto->getHeight() );
 216+
 217+ //bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted
 218+ //thumbnail sizes for the thumbnail actual size
 219+ if ( $mto->getUrl() !== $file->getUrl() ) {
 220+ $vals['thumbwidth'] = intval( $mto->getWidth() );
 221+ $vals['thumbheight'] = intval( $mto->getHeight() );
 222+ } else {
 223+ $vals['thumbwidth'] = intval( $file->getWidth() );
 224+ $vals['thumbheight'] = intval( $file->getHeight() );
 225+ }
218226 }
219227 }
220228 $vals['url'] = $file->getFullURL();
Index: trunk/phase3/RELEASE-NOTES
@@ -208,6 +208,8 @@
209209 using token and username.
210210 * (bug 23524) Api Modules as followup to bug 14473 (Add iwlinks table to
211211 track inline interwiki link usage.
 212+* (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when
 213+ thumbnailing larger than original image
212214
213215 === Languages updated in 1.17 ===
214216

Status & tagging log