From: Sam Reed Date: Tue, 8 Jun 2010 12:15:48 +0000 (+0000) Subject: * (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when thumbn... X-Git-Tag: 1.31.0-rc.0~36588 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=b744fdba237f8d7ae69b16e527310d1b19399323;p=lhc%2Fweb%2Fwiklou.git * (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when thumbnailing larger than original image Minor comment casing tweak in File.php --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ab91f9335d..b80eb88a7e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -208,6 +208,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN using token and username. * (bug 23524) Api Modules as followup to bug 14473 (Add iwlinks table to track inline interwiki link usage. +* (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when + thumbnailing larger than original image === Languages updated in 1.17 === diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 2d58003fb4..85d1532fe4 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -212,8 +212,16 @@ class ApiQueryImageInfo extends ApiQueryBase { $mto = $file->transform( array( 'width' => $scale['width'], 'height' => $scale['height'] ) ); if ( $mto && !$mto->isError() ) { $vals['thumburl'] = wfExpandUrl( $mto->getUrl() ); - $vals['thumbwidth'] = intval( $mto->getWidth() ); - $vals['thumbheight'] = intval( $mto->getHeight() ); + + //bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted + //thumbnail sizes for the thumbnail actual size + if ( $mto->getUrl() !== $file->getUrl() ) { + $vals['thumbwidth'] = intval( $mto->getWidth() ); + $vals['thumbheight'] = intval( $mto->getHeight() ); + } else { + $vals['thumbwidth'] = intval( $file->getWidth() ); + $vals['thumbheight'] = intval( $file->getHeight() ); + } } } $vals['url'] = $file->getFullURL(); diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index 9e9834875a..2bc7f06387 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -1054,7 +1054,7 @@ abstract class File { } /** - * Get an image size array like that returned by getimagesize(), or false if it + * Get an image size array like that returned by getImageSize(), or false if it * can't be determined. * * @param $fileName String: The filename