1

I am currently undertaking some house keeping project using Magento and have noticed duplicate images on our server.

I believe that the issue is where configurable products with a number of associated simple items have been loaded into the system via a CSV file.

For example:

simple | small | /t-shirt-black-sku-1.jpg
simple | medium | /t-shirt-black-sku-1.jpg
configurable | /t-shirt-black-sku-1.jpg

Looking in the catalog/product folder on the server I see the following:

t-shirt-black-sku-1
t-shirt-black-sku-1_1
t-shirt-black-sku-1_2

We will soon be moving hosting providers and I want to ensure that we are not importing across any unnecessary files. As you can imagine, the duplicate images are bloating the overall size of the website considerably.

My questions is: Are the images for the associated simple items really necessary and are there any drawbacks to deleting them from the server?

I'm guessing that going forward, the best thing is to not include the product image name in the CSV for the associated simple items within a configurable product.

I hope this makes sense and any advice would be greatly appreciated.

1 Answer 1

1

If you are running a Mage_ImportExport routine to import that csv file, each time the import runs it will generate a new image on the system with a suffix _x where x is the next free number. We've found this behaviour quite annoying.

3
  • Yes, the import is done via the Dataflow - Advanced Profiles option. I believe it is using a script that an agency created for the company. I am thinking that the only way around this issue is to only specify the images in the configurable row of the CSV and leave the associated simple items empty. The simple items are not visible so it shouldn't make any difference. The only thing I'm a little doubtful of is whether Google crawls those images. Commented May 13, 2014 at 13:46
  • If you leave the images in media/import and run the profile again with the same data, you'll still end up with a duplicate copies, I can't remember off hand whether you get dupes from importing the same image multiple times in the same file, you probably do. I wrote a cleanup script that removes all images from the HDD that aren't associated with a product in the DB which works, so you should be fine. We still get 'crawling' filenames, which is far from perfect. Commented May 13, 2014 at 13:57
  • We only import the full product CSV once and any further changes are made using an import created in Dataflow - Profiles which allows for required fields to be mapped. This allows us to update only specific aspects of products, e.g. price and doesn't involve images. Commented May 13, 2014 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.