From 307264971eeb19a20c563496583cbb724492f46d Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 22 Jan 2008 21:46:29 +0000 Subject: [PATCH] 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 --- RELEASE-NOTES | 3 ++- includes/api/ApiQueryImageInfo.php | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) 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(); -- 2.20.1