IProviderV2
in
Public interface for preview providers.
A preview provider generates a thumbnail image for supported files. That image may be stored and reused by the preview system.
Tags
Table of Contents
Methods
- getMimeType() : string
- Returns a regex matching the MIME types supported by this provider.
- getThumbnail() : IImage|null
- Generates a thumbnail image for the given file.
- isAvailable() : bool
- Returns whether this provider can currently generate a thumbnail for the given file.
Methods
getMimeType()
Returns a regex matching the MIME types supported by this provider.
public
getMimeType() : string
Tags
Return values
stringgetThumbnail()
Generates a thumbnail image for the given file.
public
getThumbnail(File $file, int $maxX, int $maxY) : IImage|null
Parameters
- $file : File
- $maxX : int
-
Maximum thumbnail width; the returned image may be smaller depending on its aspect ratio
- $maxY : int
-
Maximum thumbnail height; the returned image may be smaller depending on its aspect ratio
Tags
Return values
IImage|null —Null if no thumbnail could be generated
isAvailable()
Returns whether this provider can currently generate a thumbnail for the given file.
public
isAvailable(FileInfo $file) : bool
Parameters
- $file : FileInfo