Nextcloud PHP API (master)

IProviderV2

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
since
17.0.0

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
since
17.0.0
Return values
string

getThumbnail()

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
since
17.0.0
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
Tags
since
17.0.0
Return values
bool
On this page

Search results