cancel
Showing results for 
Search instead for 
Did you mean: 

Uploading Images and duplicate images

SOLVED

Uploading Images and duplicate images

Hi Everyone, apologies if daft question! Smiley Very Happy

 

I'm new to Magento and far from a developer but try and learn things as I go. My hosts have informed me I keep using up all of my disk space creating my new site on Magento2.When they've looked into it further they've found its mostly images that are clogging it up. When I look,a lot of my product images are being duplicated. Here comes the daft bit! I might have 20 products that are all using the same picture but the product is available in different sizes so I've chosen to make them as separate simple products. Can I not somehow get all 20 products to link and use the same pictures? My Magento is duplicating the pictures for every product. So for example, every product has 5 pictures, so instead of having 5 pictures being hosted, its duplicating them for each product and storing 50 pictures?

 

Should I hang my shame with embarrassment or am I not actually daft??

 

Thanks in advance.

Iain 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Uploading Images and duplicate images

Hi @gorillaracking

 

I understand the problem you are facing !

 

But Its core functionality of magento. If one image(a.jpeg) have uploaded for some product(A). Again we upload the same image(a.jpg) for another product its uploaded (a_1.jpg). Its the default core functionality of magento

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

View solution in original post

Re: Uploading Images and duplicate images

Hi @gorillaracking

 

Glad to know that you have resolved your issue , Happy to help and keep helping Smiley Happy

if issue solved,Click Kudos & Accept as Solution

View solution in original post

5 REPLIES 5

Re: Uploading Images and duplicate images

Hi @gorillaracking

 

I understand the problem you are facing !

 

But Its core functionality of magento. If one image(a.jpeg) have uploaded for some product(A). Again we upload the same image(a.jpg) for another product its uploaded (a_1.jpg). Its the default core functionality of magento

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: Uploading Images and duplicate images

Thanks so much Dave, just seemed weird as I keep running out of disk space but now I know its normal I can work around it.

 

Thanks again

 

Iain

Re: Uploading Images and duplicate images

Hi @gorillaracking

 

Glad to know that you have resolved your issue , Happy to help and keep helping Smiley Happy

if issue solved,Click Kudos & Accept as Solution

Re: Uploading Images and duplicate images

Sorry to open this issue after long time, but I ran into same problem. Is there ANY way how to stop this magento functionality? We have approx 7K products online. Total size of the original images folder is approx 20GB. by duplicating same images over and over again we reached 180GB disk size. For example one particular image that I use for custom made product is coppied 231 times (custom-product_1, custom product_2 etc...), which consumed totally 175,7 MB of disk space. Image itfself is only 760 kB big.

Everytime I use some of my csv file for add/update, it creates fresh new sets of coppied images.

If there is any solution how to stop this, I'm all ears.

Re: Uploading Images and duplicate images

If I'm facing a similar issue, this is what I would do. 

 

A- have a developer to patch the codebase and extend your Magento to make it NOT do that. And then freshly import all products images.

See https://magento.stackexchange.com/questions/226792/magento-2-2-product-images-duplicated

 

B- a work around: 

 

1- I would gather info about the file names format for the images. Once that is confirmed.

 

2- Then I would go to the database and run a basic query on the catalog_product_entity_varchar table to replace and trim images names that has _x to their original image name assuming removing the _x is correct. 

 

3- Then I would delete the images from the server.

  • This can be done by installing an extension that deletes unused images (assuming step 2 is done right, then these images shouldn't' be used by any product).
  • Or, instead of extension, to write a command line and execute it that goes and deletes all images with the format _x under /pub/media/catalog/product directory.