|
MediaWiki master
|
Media transform output for images. More...
Inherits MediaWiki\Media\MediaTransformOutput.
Public Member Functions | ||||
| __construct ( $file, $url, $path=false, $parameters=[]) | ||||
| Get a thumbnail object from a file and parameters. | ||||
| getAttribs (array $options=[]) | ||||
Return extra attributes that should be present on the media tag in the HTML.Takes the same option array as toHtml() (and should be used by the implementation of toHtml()).
| ||||
| toHtml ( $options=[]) | ||||
Return HTML <img ... /> tag for the thumbnail, will include width and height attributes and a blank alt text (as required). | ||||
Public Member Functions inherited from MediaWiki\Media\MediaTransformOutput | ||||
| fileIsSource () | ||||
| Check if the output thumbnail is the same as the source. | ||||
| getDescLinkAttribs ( $title=null, $params=[]) | ||||
| getExtension () | ||||
| Get the final extension of the thumbnail. | ||||
| getFile () | ||||
| getHeight () | ||||
| getLocalCopyPath () | ||||
| Get the path of a file system copy of the thumbnail. | ||||
| getStoragePath () | ||||
| getUrl () | ||||
| getWidth () | ||||
| hasFile () | ||||
| Check if an output thumbnail file actually exists. | ||||
| isError () | ||||
| This will be overridden to return true in error classes. | ||||
| setStoragePath ( $storagePath) | ||||
| streamFile ( $headers=[]) | ||||
| Stream the file if there were no errors. | ||||
| streamFileWithStatus ( $headers=[]) | ||||
| Stream the file if there were no errors. | ||||
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\Media\MediaTransformOutput | |
| array | $responsiveUrls = [] |
| Associative array mapping optional supplementary image files from pixel density (eg 1.5 or 2) to additional URLs. | |
Protected Member Functions inherited from MediaWiki\Media\MediaTransformOutput | |
| linkWrap ( $linkAttribs, $contents) | |
| Wrap some XHTML text in an anchor tag with the given attributes or, fallback to a span in the absence thereof. | |
Protected Attributes inherited from MediaWiki\Media\MediaTransformOutput | |
| File | $file |
| int | $height |
| Image height. | |
| string false | $lang |
| Language code, false if not set. | |
| string false | $page |
| string null false | $path |
| Filesystem path to the thumb. | |
| string false | $storagePath = false |
| Permanent storage path. | |
| string false | $url |
| URL path to the thumb. | |
| int | $width |
| Image width. | |
Media transform output for images.
Definition at line 25 of file ThumbnailImage.php.
| MediaWiki\Media\ThumbnailImage::__construct | ( | $file, | |
| $url, | |||
| $path = false, | |||
| $parameters = [] ) |
Get a thumbnail object from a file and parameters.
| File | $file | |
| string | $url | URL path to the thumb |
| string | null | false | $path | Filesystem path to the thumb If $path is set to null, the output file is treated as a source copy. If $path is set to false, no output file will be created. |
| array | $parameters | Associative array of parameters
|
Definition at line 41 of file ThumbnailImage.php.
References MediaWiki\Media\MediaTransformOutput\$file, MediaWiki\Media\MediaTransformOutput\$path, and MediaWiki\Media\MediaTransformOutput\$url.
| MediaWiki\Media\ThumbnailImage::getAttribs | ( | array | $options = [] | ) |
Return extra attributes that should be present on the media tag in the HTML.Takes the same option array as toHtml() (and should be used by the implementation of toHtml()).
| array | $options | See options parameter of toHtml() |
Reimplemented from MediaWiki\Media\MediaTransformOutput.
Definition at line 83 of file ThumbnailImage.php.
| MediaWiki\Media\ThumbnailImage::toHtml | ( | $options = [] | ) |
Return HTML <img ... /> tag for the thumbnail, will include width and height attributes and a blank alt text (as required).
| array | $options | Associative array of options. Boolean options should be indicated with a value of true for true, and false or absent for false. |
<img> tag, if there is such a tagFor images, desc-link and file-link are implemented as a click-through. For sounds and videos, they may be displayed in other ways.
Reimplemented from MediaWiki\Media\MediaTransformOutput.
Definition at line 184 of file ThumbnailImage.php.
References MediaWiki\Html\element(), and MediaWiki\MediaWikiServices\getInstance().