41 parent::__construct($context);
53 $directive = $this->
getRequest()->getParam(
'___directive');
54 $directive = $this->urlDecoder->decode($directive);
55 $imagePath = $this->_objectManager->create(\
Magento\Cms\Model\Template\Filter::class)->filter($directive);
57 $image = $this->_objectManager->get(\
Magento\Framework\Image\AdapterFactory::class)->create();
59 $resultRaw = $this->resultRawFactory->create();
62 $resultRaw->setHeader(
'Content-Type',
$image->getMimeType());
63 $resultRaw->setContents(
$image->getImage());
64 }
catch (\Exception $e) {
65 $imagePath = $this->_objectManager->get(
66 \
Magento\Cms\Model\Wysiwyg\Config::class
67 )->getSkinImagePlaceholderPath();
69 $resultRaw->setHeader(
'Content-Type',
$image->getMimeType());
70 $resultRaw->setContents(
$image->getImage());
71 $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
__construct(Action\Context $context, \Magento\Framework\Url\DecoderInterface $urlDecoder, \Magento\Framework\Controller\Result\RawFactory $resultRawFactory)