mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 00:05:00 +00:00
Expose file size and MIME to Lua
Use cases: - size: Showing links (like to SVG validator) conditionally (e.g. only if the filesize is below the threshold it can work on) - mime: No longer have to guess the MIME type based on the file extension. We use the MIME type for displaying correct and precise information about maximum thumbnailable sizes in case an uploaded work exceeds this limit. This change will not have negative impact on performance; as soon as width or height is loaded, the two newly added information are gratis. Change-Id: I25aad85c2a558a684aca83374aeb628f355fad1c
This commit is contained in:
parent
f62b6b4379
commit
fba298c26f
|
@ -309,6 +309,8 @@ class Scribunto_LuaTitleLibrary extends Scribunto_LuaLibraryBase {
|
|||
'exists' => true,
|
||||
'width' => $file->getWidth(),
|
||||
'height' => $file->getHeight(),
|
||||
'mimeType' => $file->getMimeType(),
|
||||
'size' => $file->getSize(),
|
||||
'pages' => $pages
|
||||
) );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue