Get the thumbmime from the handler instead of guessing it with UnregisteredLocalFile.
This commit is contained in:
parent
7afd378a4d
commit
100ecff40e
1 changed files with 5 additions and 3 deletions
|
|
@ -357,9 +357,11 @@ class ApiQueryImageInfo extends ApiQueryBase {
|
|||
$vals['thumbheight'] = intval( $file->getHeight() );
|
||||
}
|
||||
|
||||
if ( isset( $prop['thumbmime'] ) ) {
|
||||
$thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false );
|
||||
$vals['thumbmime'] = $thumbFile->getMimeType();
|
||||
if ( isset( $prop['thumbmime'] ) && $file->getHandler() ) {
|
||||
list( $ext, $mime ) = $file->getHandler()->getThumbType(
|
||||
substr( $mto->getPath(), strrpos( $mto->getPath(), '.' ) + 1 ),
|
||||
$file->getMimeType(), $thumbParams );
|
||||
$vals['thumbmime'] = $mime;
|
||||
}
|
||||
} else if ( $mto && $mto->isError() ) {
|
||||
$vals['thumberror'] = $mto->toText();
|
||||
|
|
|
|||
Loading…
Reference in a new issue