From: Roan Kattouw Date: Tue, 22 Jan 2008 21:46:29 +0000 (+0000) Subject: API: X-Git-Tag: 1.31.0-rc.0~49836 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=307264971eeb19a20c563496583cbb724492f46d;p=lhc%2Fweb%2Fwiklou.git API: * 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 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b5f152d2e1..dc1e4965f3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 73757cecb4..1b1d4b3a60 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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();