Counting Number in Picture File Name

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hello,

I use the file system as storage for my pictures. Any uploaded picture is saved to the image-Folder and renamed as a number with the id at its end and a counting number (e.g. 0000023_0.jpg).

My question is: What is the counting number for? In my case it is always 0.

Kind regards, Stephan
4 years ago
Hello Stephan,

You can find the generation of the picture name in the PictureService.cs (~/Libraries/Nop.Services/Media/PictureService.cs) on line 169:
var fileName = $"{pictureId:0000000}_0.{lastPart}";

The first number is the picture id with some zeroes in front of it. Then there is a "_" character and the number after that indicates the width of the picture in pixels. NopCommerce generates different thumbs for different sizes of the picture so it doesn't always load the large original size image. The 0 should indicate that that is the original image that was uploaded, unchanged by the nopCommerce application.

Hope that helps!

Regards,
Anton
4 years ago
Thanks!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.