Skip to content

Commit

Permalink
added new asset events: asset.image.thumbnail asset.video.image-thumb…
Browse files Browse the repository at this point in the history
…nail asset.document.image-thumbnail
  • Loading branch information
brusch committed Jun 28, 2016
1 parent d2ab488 commit c54a954
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pimcore/models/Asset/Document/ImageThumbnail.php
Expand Up @@ -152,6 +152,7 @@ public function generate()
}

$this->filesystemPath = $path;
\Pimcore::getEventManager()->trigger("asset.document.image-thumbnail", $this);
} catch (\Exception $e) {
\Logger::error("Couldn't create image-thumbnail of document " . $this->asset->getRealFullPath());
\Logger::error($e);
Expand Down
3 changes: 3 additions & 0 deletions pimcore/models/Asset/Image/Thumbnail.php
Expand Up @@ -136,6 +136,9 @@ public function generate($deferredAllowed = true)
try {
$deferred = ($deferredAllowed && $this->deferred) ? true : false;
$this->filesystemPath = Thumbnail\Processor::process($this->asset, $this->config, null, $deferred, true);
\Pimcore::getEventManager()->trigger("asset.image.thumbnail", $this, [
"deferred" => $deferred
]);
} catch (\Exception $e) {
$this->filesystemPath = $errorImage;
\Logger::error("Couldn't create thumbnail of image " . $this->asset->getRealFullPath());
Expand Down
1 change: 1 addition & 0 deletions pimcore/models/Asset/Video/ImageThumbnail.php
Expand Up @@ -171,6 +171,7 @@ public function generate()

try {
$path = Image\Thumbnail\Processor::process($this->asset, $this->getConfig(), $path, false, true);
\Pimcore::getEventManager()->trigger("asset.video.image-thumbnail", $this);
} catch (\Exception $e) {
\Logger::error("Couldn't create image-thumbnail of video " . $this->asset->getRealFullPath());
\Logger::error($e);
Expand Down

0 comments on commit c54a954

Please sign in to comment.