Clean Up Images Folder (and thumb folder)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Is there a benefit to using the file system to store images over the database method?

Thanks,
Tony
6 years ago
Carneno wrote:
Is there a benefit to using the file system to store images over the database method?

Thanks,
Tony


For me, it’s so my DB isn’t 3 gigs in size. Other than that. I’m not sure
6 years ago
So you have a smaller database.

Do the images on disk still take up the same amount of disk space?

Thanks,
Tony
6 years ago
Carneno wrote:
So you have a smaller database.

Do the images on disk still take up the same amount of disk space?

Thanks,
Tony


Hi Tony,

The thumb images are still going to be created on disk even if you DB to store original images because it is required to be on the file system when it is requested. When nopCommerce does not find it on File System, it will generate the thumb based on the requirements by using the original image stored in DB.

The benefit you get by storing original images in DB is the ease of migration & backup. You just take DB and its done. The required thumbs will be created automatically.

If your intention is to keep DB size small then you should switch to store original image on disk instead of DB. And Yes, the original images when stored on disk are still going to use the disk space. (but you get smaller db size)

Hope it helps.

Regards,

Krunal
6 years ago
Thanks very much Krunal.

Yes, it does help.

Tony
3 years ago
embryo wrote:
Okay, cool. Thanks for the reply!
But...just so I am clear...how can it "create them on the fly"???
I mean, if they aren't stored as BLOBs, how can nop "create" them? From what "source" will they be derived??
From the parent "/images" folder?


Did you ever resolve your question? I am wondering the same thing? How can nop recreate them if you delete them? Looking at all the files, I dont see any originals to recreate from.

But this is really great if I can simply delete them. I have been struggling with this for over a year. This will save me hours if not days of time fixing this problem of too many thumbs created over the years. Literally thousands. LOL
3 years ago
The original image is stored in the root of the wwwroot\images folder. The thumbs are created based of the media settings you have setup in the configuration of your site and placed in the \wwwroot\images\thumbs directory. So the original file is not deleted and new thumbs will be generated through the picture services of the code if not found. I am sure there is a more technical answer but that is the just of it. It can become a very time consuming job of re-uploading thousands and thousands of thumb images, although each is quite small in size. Uploading is typically slower for most users so re-uploading this directory becomes the biggest part of the site. Hence in the upgrade docs they tell you to not delete the images folder. I originally was using the db to store images, but if your using high resolution images the db can grow quite large and based on your hosting setup, I found performance of the db was effected dramatically. What would be nice is a utillity to manage the image folder seperately some where in the admin, which probably opens issues of permissions on the servers.
3 years ago
glhays wrote:
The original image is stored in the root of the wwwroot\images folder. The thumbs are created based of the media settings you have setup in the configuration of your site and placed in the \wwwroot\images\thumbs directory. So the original file is not deleted and new thumbs will be generated through the picture services of the code if not found. I am sure there is a more technical answer but that is the just of it. It can become a very time consuming job of re-uploading thousands and thousands of thumb images, although each is quite small in size. Uploading is typically slower for most users so re-uploading this directory becomes the biggest part of the site. Hence in the upgrade docs they tell you to not delete the images folder. I originally was using the db to store images, but if your using high resolution images the db can grow quite large and based on your hosting setup, I found performance of the db was effected dramatically. What would be nice is a utillity to manage the image folder seperately some where in the admin, which probably opens issues of permissions on the servers.


I understand you perfectly. I love the concept of being able to delete the thumbs and they will be recreated according to your settings. Changing themes, upgrading and stuff creates too many thumbs. Now that that issue in bed. I have a new challenge......

The [root] images in the image folder are all different sizes on this site I'm working on .. I'm pretty good in photoshop and I can batch process them to be all the same size.
My question is now: If I replace the [root] images with my resized images [with the same file name and extension] and upload them via FileZilla with the correct size will I run into errors?

If I can do that.. my goodness...
3 years ago
No as long as the image name stays the same it can be found.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.