API:
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 22 Jan 2008 21:46:29 +0000 (21:46 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 22 Jan 2008 21:46:29 +0000 (21:46 +0000)
* Returning proportions of thumbnailed image
* INTERFACE CHANGE: thumbnail url is now returned as "thumburl" rather than "url"
* Adding RELEASE-NOTES entry that should've been added a couple of days ago

RELEASE-NOTES
includes/api/ApiQueryImageInfo.php

index b5f152d..dc1e496 100644 (file)
@@ -459,7 +459,8 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * prop=imageinfo interface changed: iihistory replaced by iilimit, iistart and iiend parameters
 * Added amlang parameter to meta=allmessages
 * Added apfilterlanglinks parameter to list=allpages, replacing query.php?what=nolanglinks
-* (bug 12718) Added action=paraminfo module that provides information about API modules and their parameters 
+* (bug 12718) Added action=paraminfo module that provides information about API modules and their parameters
+* Added iiurlwidth and iiurlheight parameters to prop=imageinfo
 
 === Languages updated in 1.12 ===
 
index 73757ce..1b1d4b3 100644 (file)
@@ -118,10 +118,15 @@ class ApiQueryImageInfo extends ApiQueryBase {
                }
                if($this->fld_url) {
                        if($this->scale && !$f->isOld()) {
-                               $vals['url'] = $f->createThumb($this->urlwidth, $this->urlheight);
-                       } else {
-                               $vals['url'] = $f->getURL();
+                               $thumb = $f->getThumbnail($this->urlwidth, $this->urlheight);
+                               if($thumb)
+                               {
+                                       $vals['thumburl'] = $thumb->getURL();
+                                       $vals['thumbwidth'] = $thumb->getWidth();
+                                       $vals['thumbheight'] = $thumb->getHeight();
+                               }
                        }
+                       $vals['url'] = $f->getURL();
                }
                if($this->fld_comment) 
                        $vals['comment'] = $f->getDescription();