0

I am adding new products , and I want to copy the images , and keep them with the same name. In most cases it seems to work , but one particular product ( and possibly others ) has me baffled.

  • I have deleted ALL products
  • I have deleted ALL images in media/catalog/product
  • I have disabled the cache , redindxed and I have even a run magerun addon to remove any orphan references / orphan files.

I am using addImagetoMediaGallery

$targetProduct->addImageToMediaGallery($importFilepath,$sourceImage['types'],false,$sourceImage['exclude']);

The image is set up correctly in terms of linking to the product and correct types , however it persists in adding a _1 to the and of the first part of the filename

So:

th_new-l_4_2.jpg

becomes

th_new-l_4_2_1.jpg

( Yes I do realise that it already has numbers appended from previous database )

Note: For other products , it seems to keep the filename as is.

This image does not exist anywhere that I can find in either the file system or the database ( I have been through pretty much all of the product / attribute / media tables.

If you have any idea why it would be doing this when the product does not exist I would appreciate your time. Thanks!

1 Answer 1

0

Ok - figured it out. The file was in \media\tmp\catalog\product\t\h

I didn't even know that that directory existed / was part of the process as a temporary place to put the file. somehow the file was "stuck" there. I spent way too long finding that.

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.