r85194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85193‎ | r85194 | r85195 >
Date:14:49, 2 April 2011
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
Get the thumbmime from the handler instead of guessing it with UnregisteredLocalFile.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -357,9 +357,11 @@
358358 $vals['thumbheight'] = intval( $file->getHeight() );
359359 }
360360
361 - if ( isset( $prop['thumbmime'] ) ) {
362 - $thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false );
363 - $vals['thumbmime'] = $thumbFile->getMimeType();
 361+ if ( isset( $prop['thumbmime'] ) && $file->getHandler() ) {
 362+ list( $ext, $mime ) = $file->getHandler()->getThumbType(
 363+ substr( $mto->getPath(), strrpos( $mto->getPath(), '.' ) + 1 ),
 364+ $file->getMimeType(), $thumbParams );
 365+ $vals['thumbmime'] = $mime;
364366 }
365367 } else if ( $mto && $mto->isError() ) {
366368 $vals['thumberror'] = $mto->toText();

Sign-offs

UserFlagDate
Catropeinspected13:07, 3 April 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r852561.17wmf1: MFT r80813, r80815, r83798, r84459, r84729, r84820, r84921, r84985,...catrope14:13, 3 April 2011
r85435MFT: r84431, r84464, r84543, r84553, r84573, r84574, r84577, r84729, r84765, ...demon14:00, 5 April 2011

Comments

#Comment by Bryan (talk | contribs)   14:50, 2 April 2011

Marking wmf because mark wanted this.

Status & tagging log