Missing images after update

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

After updating to 4, many (but not all) of our product images seem to have disappeared.  They are still in the images folder, but they're not showing on the website.

If I take one of the products with a missing picture and look for it in SQL Server, I see the images returned.  The following query shows me four images.  Of those images, one is the missing image.

SELECT * FROM [DatabaseName].[dbo].[Product_Picture_Mapping] WHERE ProductId = 713;


If I then go looking in SQL Server for that image, I use the this query:

SELECT * FROM [DatabaseName].[dbo].[Picture] WHERE Id = 1620;


That gives me a result like this:

Id: 1620
PictureBinary: [blank]
MimeType: image/jpeg
SeoFilename: cocktail-adapters-10-pack-with-fasteners
AltAttribute: NULL
TitleAttribute: NULL
IsNew: 0

I'm not sure how PictureBinary works, but it is also blank for any pictures that are displaying properly.  

Can anyone think of any reason that these images are not showing?

Thanks!

Jeremy
4 years ago
Hello Jeremy,

The PictureBinary is blank when your pictures are stored on your file system rather than stored inside the database.
After 4.0 the ~/Content directory in nopCommerce changed to ~/wwwroot. Every content file should be located in that directory (~/wwwroot). Check to see if you have the images inside the ~/wwwroot/images/thumbs directory.

Regards,
Anton
4 years ago
"4" ?  4.00, 4.10, 4.20?

Do you see the pictures in Admin > Product  >> Pictures?

Are you storing pictures in the Database or File System?  
  https://admin-demo.nopcommerce.com/Admin/Setting/Media
4 years ago
Anton:

Those images are in the wwwroot/images/thumbs folder.  I verified again just to be sure.

Given the records for these images in the database, how  does nopCommerce know which image to use?  The SeoFilename value seems to be the product's SEO file name.  

New York:

We do not see the pictures in the admin either.  We're storing in the file system.  Also, it's 4.0.

Thanks!
4 years ago
[email protected] wrote:
Anton:

Those images are in the wwwroot/images/thumbs folder.  I verified again just to be sure.

Given the records for these images in the database, how  does nopCommerce know which image to use?  The SeoFilename value seems to be the product's SEO file name.  

New York:

We do not see the pictures in the admin either.  We're storing in the file system.  Also, it's 4.0.

Thanks!


In nopCommerce, image can be saved either in database or file system.

When it is set to file system (check @ yoursite.com/Admin/Setting/Media), then PictureBinary column in Picture table will be blank and a file will be available in wwwroot/images (from 4.0) folder (format will be pictureid_0. image extension).

When it is database, then there will no file in wwwroot/images folder, and PictureBinary column in Picture table will have some binary data.

So, at first check these conditions.
4 years ago
Hi, mhsjaber.  I've verified that I'm set to use the file system and that the images are in the correct place.

Thanks!

Jeremy
4 years ago
Everyone,

I figured out what's wrong here!

When stepping through the code, everything was okay.  To see what was happening on the server, I added some lines of logging to the image processing and realized that the missing images had a size of 0.  Ah!  When I went back into my images folder, I realized that there were a ton of images that were in place with a size of 0 KB.  I copied these images back from my source and restarted the application.  I see the images now!

Thanks for the help!  Now I'm going to go remove my logging lines before I forget about it.

Have an awesome day!

Jeremy
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.