I'm new to nopCommerce and struggling somewhat to find a way to rapidly add product images.
At first I thought I could simply drop them into the wwroot/images folder, add records to Picture adding the file name and path in VirtualPath, then the corresponding map in Product_Picture_Mapping, but that failed.
I then manually added some images to see what it did and realised the image name corresponds to the ID in Picture, so, rather than rename all images I figured I'd use the existing tools to download the existing products, add the image file path and import again. However, that also failed stating "Image cannot be loaded. Available decoders:- PNG : PngDecoder- BMP : BmpDecoder- GIF : GifDecoder- JPEG : JpegDecoder", despite all being jpg's.
This seemed odd but just to make sure, I optimised every image saving as _min.jpg to a new folder. I then modified the filepath on the Excel upload file and tried again but got the same error.
Can anyone suggest what might be wrong?
On a separate note I can see that image management appears to have been an issue in the past and that 3rd party add ons have been created to assist. Can anyone recommend one that is genuinely beneficial?
Thanks Yidna, I know my method to populate the data directly and upload the files is correct because if I rename an image from something like image_abc123.jpg, to the Picture ID e.g. 0000123_0.jpg it works fine. I'm now looking at writing a script to loop through the picture data and rename each image because I think that will be the fastest way.
Thanks I might take you up on that. I successfully renamed all the images to correspond with the types of values it expects and have tested this via the product picture mapping to verify I get a result. I then wanted to input all my products and so tried inputting via the Excel Import but this generated an error "Sequence contains no matching element" which isn't too helpful. Any ideas?
Here is the log data
Sequence contains no matching element
System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at Nop.Services.ExportImport.ImportManager.ImportProductsFromXlsx(Stream stream) in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\ExportImport\ImportManager.cs:line 1672
at Nop.Web.Areas.Admin.Controllers.ProductController.ImportExcel(IFormFile importexcelfile) in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web\Areas\Admin\Controllers\ProductController.cs:line 2280
Thanks for your input mhsjaber but for the avoidance of doubt this error occurred as I tried to input data using the Excel form generated via Product Export and then updating it with new products and going through the Import routine. Therefore, if you are correct this must be an error many have come across before.