* (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when thumbn...
authorSam Reed <reedy@users.mediawiki.org>
Tue, 8 Jun 2010 12:15:48 +0000 (12:15 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 8 Jun 2010 12:15:48 +0000 (12:15 +0000)
Minor comment casing tweak in File.php

RELEASE-NOTES
includes/api/ApiQueryImageInfo.php
includes/filerepo/File.php

index ab91f93..b80eb88 100644 (file)
@@ -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 ===
 
index 2d58003..85d1532 100644 (file)
@@ -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();
index 9e98348..2bc7f06 100644 (file)
@@ -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