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: Parameters: - $config (
OCP\IConfig
) - $previewManager (
OCP\IPreview
) - $appData (
OCP\Files\IAppData
) - $helper (
OC\Preview\GeneratorHelper
) - $eventDispatcher (
Symfony\Component\EventDispatcher\EventDispatcherInterface
)
- $config (
-
public
OC\Preview\Generator::
getPreview
($file, $width=-1, $height=-1, $crop=false, $mode=\OCP\IPreview::MODE_FILL, $mimeType=null)¶ - Returns a preview of a fileThe cache is searched first and if nothing usable was found then a preview isgenerated by one of the providers
Source: Parameters: - $file (
OCP\Files\File
) - $width (int)
- $height (int)
- $crop (bool)
- $mode (string)
- $mimeType (string)
Returns: Throws: Throws: \InvalidArgumentException
if the preview would be invalid (in case the original image is invalid)Throws: Throws: \InvalidArgumentException
if the preview would be invalid (in case the original image is invalid) - $file (
-
public
OC\Preview\Generator::
generatePreviews
($file, $specifications, $mimeType=null)¶ - Generates previews of a file
Source: Parameters: - $file (
OCP\Files\File
) - $specifications (array)
- $mimeType (string)
Returns: \OCP\Files\SimpleFS\ISimpleFile
the last preview that was generatedThrows: Throws: \InvalidArgumentException
if the preview would be invalid (in case the original image is invalid)Throws: Throws: \InvalidArgumentException
if the preview would be invalid (in case the original image is invalid) - $file (