* (bug 23835) Need "thumbmime" result in "imageinfo" query
authorSam Reed <reedy@users.mediawiki.org>
Tue, 8 Jun 2010 12:40:11 +0000 (12:40 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 8 Jun 2010 12:40:11 +0000 (12:40 +0000)
RELEASE-NOTES
includes/api/ApiQueryImageInfo.php

index 24692bf..ebcbd86 100644 (file)
@@ -212,6 +212,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   similar to prop=categories's clcategorie
 * (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when
   thumbnailing larger than original image
+* (bug 23835) Need "thumbmime" result in "imageinfo" query
 
 === Languages updated in 1.17 ===
 
index 85d1532..4590615 100644 (file)
@@ -222,6 +222,11 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                                $vals['thumbwidth'] = intval( $file->getWidth() );                                      
                                                $vals['thumbheight'] = intval( $file->getHeight() );
                                        }
+                                       
+                                       if ( isset( $prop['thumbmime'] ) ) {
+                                               $thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false );
+                                               $vals['thumbmime'] = $thumbFile->getMimeType();
+                                       }
                                }
                        }
                        $vals['url'] = $file->getFullURL();
@@ -319,6 +324,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        'dimensions', // For backwards compatibility with Allimages
                        'sha1',
                        'mime',
+                       'thumbmime',
                        'metadata',
                        'archivename',
                        'bitdepth',