Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -357,9 +357,11 @@ |
358 | 358 | $vals['thumbheight'] = intval( $file->getHeight() ); |
359 | 359 | } |
360 | 360 | |
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; |
364 | 366 | } |
365 | 367 | } else if ( $mto && $mto->isError() ) { |
366 | 368 | $vals['thumberror'] = $mto->toText(); |