Question

version Magento 2.2.2

Class Magento\Catalog\Model\View\Asset\Image not found in line 8

the following file

namespace Vnecoms\Vendors\Model\View\Asset;
use Magento\Catalog\Model\Product\Media\ConfigInterface;
use Magento\Framework\Encryption\EncryptorInterface;
use Magento\Framework\View\Asset\ContextInterface;

class Image extends \Magento\Catalog\Model\View\Asset\Image
{
    /**
     * Image constructor.
     *
     * @param ConfigInterface $mediaConfig
     * @param ContextInterface $context
     * @param EncryptorInterface $encryptor
     * @param string $filePath
     * @param array $miscParams
     */
    public function __construct(
        ConfigInterface $mediaConfig,
        ContextInterface $context,
        EncryptorInterface $encryptor,
        $filePath,
        array $miscParams = []
    ) {
        parent::__construct($mediaConfig, $context, $encryptor, $filePath, $miscParams);
    }
}

actually this line:

class Image extends \Magento\Catalog\Model\View\Asset\Image
Was it helpful?

Solution

Seems something wrong with your files, because that file exists in the Magento ver. 2.2.2. You can find it in the official repository and copy to your server https://github.com/magento/magento2/blob/2.2.2/app/code/Magento/Catalog/Model/View/Asset/Image.php

PS: I strongly recommend you to check all Magento files.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top