From: Brian Wolff Date: Mon, 12 Aug 2013 14:24:11 +0000 (-0300) Subject: Follow-up I49b7d8a - Add api module for common metadata X-Git-Tag: 1.31.0-rc.0~17183 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=b06d5ed07887b8c1f294ce78abb022c74116d53c;p=lhc%2Fweb%2Fwiklou.git Follow-up I49b7d8a - Add api module for common metadata Change-Id: I0d957891e0778ba0454f6fecb06524211506f6b9 --- diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index cfc858a3a9..baee9b1da9 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -419,6 +419,7 @@ class ApiQueryImageInfo extends ApiQueryBase { $sha1 = isset( $prop['sha1'] ); $meta = isset( $prop['metadata'] ); $extmetadata = isset( $prop['extmetadata'] ); + $commonmeta = isset( $prop['commonmetadata'] ); $mime = isset( $prop['mime'] ); $mediatype = isset( $prop['mediatype'] ); $archive = isset( $prop['archivename'] ); @@ -490,6 +491,10 @@ class ApiQueryImageInfo extends ApiQueryBase { } $vals['metadata'] = $metadata ? self::processMetaData( $metadata, $result ) : null; } + if ( $commonmeta ) { + $metaArray = $file->getCommonMetaArray(); + $vals['commonmetadata'] = $metaArray ? self::processMetaData( $metaArray, $result ) : array(); + } if ( $extmetadata ) { // Note, this should return an array where all the keys @@ -672,6 +677,7 @@ class ApiQueryImageInfo extends ApiQueryBase { ' (requires url and param ' . $modulePrefix . 'urlwidth)', 'mediatype' => ' mediatype - Adds the media type of the image', 'metadata' => ' metadata - Lists Exif metadata for the version of the image', + 'commonmetadata' => ' commonmetadata - Lists file format generic metadata for the version of the image', 'extmetadata' => ' extmetadata - Lists formatted metadata combined ' . 'from multiple sources. Results are HTML formatted.', 'archivename' => ' archivename - Adds the file name of the archive ' .