r83286 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83285‎ | r83286 | r83287 >
Date:14:56, 5 March 2011
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
(bug 27590) prop=imageinfo now allows querying the media type
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -329,10 +329,11 @@
330330 $sha1 = isset( $prop['sha1'] );
331331 $meta = isset( $prop['metadata'] );
332332 $mime = isset( $prop['mime'] );
 333+ $mediatype = isset( $prop['mediatype'] );
333334 $archive = isset( $prop['archivename'] );
334335 $bitdepth = isset( $prop['bitdepth'] );
335336
336 - if ( ( $url || $sha1 || $meta || $mime || $archive || $bitdepth )
 337+ if ( ( $url || $sha1 || $meta || $mime || $mediatype || $archive || $bitdepth )
337338 && $file->isDeleted( File::DELETED_FILE ) ) {
338339 $vals['filehidden'] = '';
339340
@@ -380,6 +381,10 @@
381382 if ( $mime ) {
382383 $vals['mime'] = $file->getMimeType();
383384 }
 385+
 386+ if ( $mediatype ) {
 387+ $vals['mediatype'] = $file->getMediaType();
 388+ }
384389
385390 if ( $archive && $file->isOld() ) {
386391 $vals['archivename'] = $file->getArchiveName();
@@ -482,6 +487,7 @@
483488 'sha1',
484489 'mime',
485490 'thumbmime',
 491+ 'mediatype',
486492 'metadata',
487493 'archivename',
488494 'bitdepth',
@@ -508,6 +514,7 @@
509515 ' sha1 - Adds SHA-1 hash for the image',
510516 ' mime - Adds MIME type of the image',
511517 ' thumbmime - Adds MIME type of the image thumbnail (requires url)',
 518+ ' mediatype - Adds the media type of the image',
512519 ' metadata - Lists EXIF metadata for the version of the image',
513520 ' archivename - Adds the file name of the archive version for non-latest versions',
514521 ' bitdepth - Adds the bit depth of the version',
Index: trunk/phase3/RELEASE-NOTES
@@ -204,6 +204,7 @@
205205 * (bug 27708) list=users does not have a property to return user id
206206 * (bug 27715) imageinfo didn't respect revdelete
207207 * (bug 27862) Useremail module didn't properly return success on success.
 208+* (bug 27590) prop=imageinfo now allows querying the media type
208209
209210 === Languages updated in 1.18 ===
210211

Follow-up revisions

RevisionCommit summaryAuthorDate
r83290Follow-up r83286: detabify description for mediatypebtongminh15:14, 5 March 2011

Comments

#Comment by Reedy (talk | contribs)   15:04, 5 March 2011

Really minor issue... mediatype is tab separated from it's description, whereas the others are space separated.

Looks funny on CR, fine in my IDE, but also funny in my browser :)

#Comment by Duplicatebug (talk | contribs)   15:29, 5 March 2011

list=filearchive is missing. Maybe rewrite that module to use ApiQueryImageInfo::getInfo(), than you can fix some bugs at ones.

What about prop=stashimageinfo? I think a stash file has a media type.

#Comment by Duplicatebug (talk | contribs)   11:22, 3 March 2012

for list=filearchive: bug 34927

#Comment by Reedy (talk | contribs)   23:01, 20 March 2011

<ii mime="image/png" mediatype="BITMAP" />

Looks weird (not api related)

Good otherwise

Status & tagging log