Magento Dataflow Images Not Working + Solution

If you are struggling to understand why Magento is not finding images that are definitely there, the problem may well be that you are not prefixing your image with a slash, i.e for a new image we would put:

/image.jpg

and the image would be in

media/import/image.jpg

Unfortunately whoever wrote the Dataflow product importer though it would be a good idea to silently capture all exceptions on image imports which removes any useful error messages that might occur (such as no image at media/importimage.jpg)

If you would prefer to fix this, you can override Mage_Catalog_Model_Convert_Adapter_Product

Copy the saveRow() method into your overriding class and then change this bit

foreach ($imageData as $file => $fields) {
            try {
                $filepath = Mage::getBaseDir('media') . DS . 'import' . trim($file);
                $product->addImageToMediaGallery($filepath, $fields);
            } catch (Exception $e) {}
        }

To something like this

foreach ($imageData as $file => $fields) {
            //try {
                $filepath = Mage::getBaseDir('media') . DS . 'import' . trim($file);
                $product->addImageToMediaGallery($filepath, $fields);
           //} catch (Exception $e) {}
        }

Tags: magentoexceptionerrorimagessolutiondataflowslash