From: Roan Kattouw Date: Wed, 12 Sep 2007 15:09:07 +0000 (+0000) Subject: (bug 11308) Allow the API to output the image metadata X-Git-Tag: 1.31.0-rc.0~51407 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=52cc645480723d69afec39eb2f059114a2c77d99;p=lhc%2Fweb%2Fwiklou.git (bug 11308) Allow the API to output the image metadata Patch by Brian Tong Minh --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b56dda287c..700cb00881 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -43,7 +43,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN editinterface to a new permission key editusercssjs. * (bug 11266) Set fallback language for Fulfulde (ff) to French * (bug 11179) Include image version deletion comment in public log -* (bug 11158) Fix escaping in API HTML-formatted JSON * Fixed notice when accessing special page without read permission and whitelist is not defined * (bug 9252) Fix for tidy funkiness when using editintro mode @@ -56,6 +55,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN Full API documentation is available at http://www.mediawiki.org/wiki/API * (bug 11275) Enable descending sort in categorymembers +* (bug 11308) Allow the API to output the image metadata === Languages updated in 1.12 === diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index da1a2d0c3f..61090957e3 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -51,6 +51,7 @@ class ApiQueryImageInfo extends ApiQueryBase { $fld_url = isset($prop['url']); $fld_size = isset($prop['size']); $fld_sha1 = isset($prop['sha1']); + $fld_metadata = isset($prop['metadata']); $pageIds = $this->getPageSet()->getAllTitlesByNamespace(); if (!empty($pageIds[NS_IMAGE])) { @@ -91,6 +92,11 @@ class ApiQueryImageInfo extends ApiQueryBase { if ($fld_sha1) $vals['sha1'] = wfBaseConvert($row["{$prefix}_sha1"], 36, 16, 40); + + if ($fld_metadata) { + $metadata = unserialize($row["{$prefix}_metadata"]); + $vals['metadata'] = $metadata ? $metadata : null; + } $data[] = $vals; @@ -123,7 +129,8 @@ class ApiQueryImageInfo extends ApiQueryBase { 'comment', 'url', 'size', - 'sha1' + 'sha1', + 'metadata' ) ), 'history' => false,