Generator

class OC\Preview\Generator
Source:lib/private/Preview/Generator.php#46

Properties

Methods

public OC\Preview\Generator::__construct($config, $previewManager, $appData, $helper, $eventDispatcher)
Source:

lib/private/Preview/Generator.php#66

Parameters:
public OC\Preview\Generator::getPreview($file, $width=-1, $height=-1, $crop=false, $mode=\OCP\IPreview::MODE_FILL, $mimeType=null)
Returns a preview of a file
The cache is searched first and if nothing usable was found then a preview is
generated by one of the providers
Source:

lib/private/Preview/Generator.php#96

Parameters:
  • $file (OCP\Files\File)
  • $width (int)
  • $height (int)
  • $crop (bool)
  • $mode (string)
  • $mimeType (string)
Returns:

\OCP\Files\SimpleFS\ISimpleFile

Throws:

\OCP\Files\NotFoundException

Throws:

\InvalidArgumentException if the preview would be invalid (in case the original image is invalid)

Throws:

\OCP\Files\NotFoundException

Throws:

\InvalidArgumentException if the preview would be invalid (in case the original image is invalid)

public OC\Preview\Generator::generatePreviews($file, $specifications, $mimeType=null)
Generates previews of a file
Source:

lib/private/Preview/Generator.php#122

Parameters:
Returns:

\OCP\Files\SimpleFS\ISimpleFile the last preview that was generated

Throws:

\OCP\Files\NotFoundException

Throws:

\InvalidArgumentException if the preview would be invalid (in case the original image is invalid)

Throws:

\OCP\Files\NotFoundException

Throws:

\InvalidArgumentException if the preview would be invalid (in case the original image is invalid)