From bdb88da500ca494c3ce3a6a452ac326d4d8878ca Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 8 Jun 2010 12:40:11 +0000 Subject: [PATCH] * (bug 23835) Need "thumbmime" result in "imageinfo" query --- RELEASE-NOTES | 1 + includes/api/ApiQueryImageInfo.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 24692bfcca..ebcbd866b3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 85d1532fe4..4590615277 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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', -- 2.20.1