23 \
Magento\Framework\Registry $coreRegistry,
27 parent::__construct($context, $coreRegistry);
37 $imagesHelper = $this->_objectManager->get(\
Magento\Cms\Helper\Wysiwyg\Images::class);
42 $filename =
$request->getParam(
'filename');
43 $filename = $imagesHelper->idDecode($filename);
47 $forceStaticPath =
$request->getParam(
'force_static_path');
49 $this->_objectManager->get(\
Magento\Catalog\Helper\Data::class)->setStoreId(
$storeId);
52 if ($forceStaticPath) {
53 $image = parse_url($imagesHelper->getCurrentUrl() . $filename, PHP_URL_PATH);
55 $image = $imagesHelper->getImageHtmlDeclaration($filename, $asIs);
59 $resultRaw = $this->resultRawFactory->create();
60 return $resultRaw->setContents(
$image);
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\Controller\Result\RawFactory $resultRawFactory)