From 6b70a9f1217438274b46b5e0787fcba50e48f755 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 5 Mar 2011 14:56:49 +0000 Subject: [PATCH] (bug 27590) prop=imageinfo now allows querying the media type --- RELEASE-NOTES | 1 + includes/api/ApiQueryImageInfo.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9c92368e1a..e705314ac3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -204,6 +204,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 27708) list=users does not have a property to return user id * (bug 27715) imageinfo didn't respect revdelete * (bug 27862) Useremail module didn't properly return success on success. +* (bug 27590) prop=imageinfo now allows querying the media type === Languages updated in 1.18 === diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 7673f0a99b..b5831d6606 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -329,10 +329,11 @@ class ApiQueryImageInfo extends ApiQueryBase { $sha1 = isset( $prop['sha1'] ); $meta = isset( $prop['metadata'] ); $mime = isset( $prop['mime'] ); + $mediatype = isset( $prop['mediatype'] ); $archive = isset( $prop['archivename'] ); $bitdepth = isset( $prop['bitdepth'] ); - if ( ( $url || $sha1 || $meta || $mime || $archive || $bitdepth ) + if ( ( $url || $sha1 || $meta || $mime || $mediatype || $archive || $bitdepth ) && $file->isDeleted( File::DELETED_FILE ) ) { $vals['filehidden'] = ''; @@ -380,6 +381,10 @@ class ApiQueryImageInfo extends ApiQueryBase { if ( $mime ) { $vals['mime'] = $file->getMimeType(); } + + if ( $mediatype ) { + $vals['mediatype'] = $file->getMediaType(); + } if ( $archive && $file->isOld() ) { $vals['archivename'] = $file->getArchiveName(); @@ -482,6 +487,7 @@ class ApiQueryImageInfo extends ApiQueryBase { 'sha1', 'mime', 'thumbmime', + 'mediatype', 'metadata', 'archivename', 'bitdepth', @@ -508,6 +514,7 @@ class ApiQueryImageInfo extends ApiQueryBase { ' sha1 - Adds SHA-1 hash for the image', ' mime - Adds MIME type of the image', ' thumbmime - Adds MIME type of the image thumbnail (requires url)', + ' mediatype - Adds the media type of the image', ' metadata - Lists EXIF metadata for the version of the image', ' archivename - Adds the file name of the archive version for non-latest versions', ' bitdepth - Adds the bit depth of the version', -- 2.20.1