(bug 27590) prop=imageinfo now allows querying the media type
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 5 Mar 2011 14:56:49 +0000 (14:56 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 5 Mar 2011 14:56:49 +0000 (14:56 +0000)
RELEASE-NOTES
includes/api/ApiQueryImageInfo.php

index 9c92368..e705314 100644 (file)
@@ -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 ===
 
index 7673f0a..b5831d6 100644 (file)
@@ -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',