izybit wrote:When an image is uploaded it takes the name of the product plus some identification numbers.
When images are set to store in the file system and a new image is uploaded through the admin interface it gets renamed to the id of the newly created record in the Picture table with _0 appended on the end. You can see these images in the
\Content\Images folder of your website. This renaming process ensures that all image names are unique and prevents nop from having to deal with what happens if the user tries to upload images with filenames that already exist. It does however make reusing the same image across multiple products very difficult.
I think you're talking about the images in the
\Content\Images\Thumbs folder. These images are generated on demand by the function in the
picture service that generates the image URLs that are used in the src attribute of the img tags in the website. These are named by taking the image id, appending an seo friendly version of the product name (localised for the current language), then appending the thumbnail dimension. You can see that these are created on demand by renaming a product and seeing that new thumbnails will be generated next time you browse to it. Similarly you can just delete all these images and they'll be regenerated when required (though it's extremely memory and processor intensive to create the thumbnails so not necessarily a good idea if you have thousands of images).
izybit wrote:Does anyone know how to disable the automatic image renaming?
I just need the original name to remain intact.
With images set to store in the file system the only link that exists back to the record in the Picture table is the fact that the filename includes the image id. This makes it difficult to retain the original file name as you suggest because there isn't currently anywhere in the Picture table to store it. You'd have to add an additional column to the Picture table and associated Picture entity to store the filename and then update the functions in the PictureService to use that filename instead of the image id to locate the images on disk. You'd also have to work out some method of handling duplicate filenames, though this could be as simple as overwriting them or warning the user.
So yeah, it's possible with a bit of customisation but there isn't a setting in the admin site for it.