Added pre and post processing event disatching
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
namespace Thelia\Core\Event\Image;
|
||||
|
||||
use Imagine\Image\ImageInterface;
|
||||
use Thelia\Core\Event\CachedFileEvent;
|
||||
|
||||
class ImageEvent extends CachedFileEvent
|
||||
@@ -71,6 +72,11 @@ class ImageEvent extends CachedFileEvent
|
||||
*/
|
||||
protected $quality = null;
|
||||
|
||||
/**
|
||||
* @var ImageInterface
|
||||
*/
|
||||
protected $imageObject;
|
||||
|
||||
/**
|
||||
* @return boolean true if the required image is the original image (resize_mode and background_color are not significant)
|
||||
*/
|
||||
@@ -209,4 +215,21 @@ class ImageEvent extends CachedFileEvent
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ImageInterface $imageObject
|
||||
* @return $this
|
||||
*/
|
||||
public function setImageObject($imageObject)
|
||||
{
|
||||
$this->imageObject = $imageObject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ImageInterface
|
||||
*/
|
||||
public function getImageObject() {
|
||||
return $this->imageObject;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,6 +382,16 @@ final class TheliaEvents
|
||||
*/
|
||||
const IMAGE_PROCESS = "action.processImage";
|
||||
|
||||
/**
|
||||
* Sent just after creating the image object from the image file
|
||||
*/
|
||||
const IMAGE_PREPROCESSING = "action.preProcessImage";
|
||||
|
||||
/**
|
||||
* Sent just before saving the processed image object on disk
|
||||
*/
|
||||
const IMAGE_POSTPROCESSING = "action.postProcessImage";
|
||||
|
||||
/**
|
||||
* Sent on document processing
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user