class DownscaleImageManager (View source)

Properties

protected $maxPixelSize
protected $rawImageSuffix
protected ImageManager $manager
protected LoggerInterface $logger
protected EntityManager $em

Methods

__construct(EntityManager $em, Packages $packages, LoggerInterface $logger = null, string $imageDriver = 'gd', integer $maxPixelSize, string $rawImageSuffix = ".raw")

No description

processAndOverrideDocument(Document $document = null)

Downscale document if needed, overriding raw document.

processDocumentFromExistingRaw(Document $document = null)

Downscale document if needed, keeping existing raw document.

Image
getDownscaledImage(Image $processImage)

Get downscaled image if size is higher than limit, returns original image if lower or if image is a GIF.

Document|bool
createDocumentFromImage(Document $originalDocument, Image $processImage = null, boolean $keepExistingRaw = false)

No description

Details

__construct(EntityManager $em, Packages $packages, LoggerInterface $logger = null, string $imageDriver = 'gd', integer $maxPixelSize, string $rawImageSuffix = ".raw")

Parameters

EntityManager $em
Packages $packages
LoggerInterface $logger
string $imageDriver
integer $maxPixelSize
string $rawImageSuffix

processAndOverrideDocument(Document $document = null)

Downscale document if needed, overriding raw document.

Parameters

Document $document

processDocumentFromExistingRaw(Document $document = null)

Downscale document if needed, keeping existing raw document.

Parameters

Document $document

protected Image getDownscaledImage(Image $processImage)

Get downscaled image if size is higher than limit, returns original image if lower or if image is a GIF.

Parameters

Image $processImage

Return Value

Image

protected Document|bool createDocumentFromImage(Document $originalDocument, Image $processImage = null, boolean $keepExistingRaw = false)

Parameters

Document $originalDocument
Image $processImage
boolean $keepExistingRaw

Return Value

Document|bool Return new Document or FALSE