Jump to content

[Resolved] correct way to remove images


keat

Recommended Posts

I've cleaned up a few orphaned images today by deleting them from the images/source folder.

However, when I edit a product and look in the images tab, these deleted images still appear in the drop down.

So what's the best method of removing orphaned images.

Link to comment
Share on other sites

I found the orphaned entries in the cubecart_filemanager table.

However, this got me thinking about the slow page refresh when editing a product.

Maybe I could export the inventory, file manager and image_index tables and use something like MS Access to link the tables and run a query to find which images are not associated with a product.

If i then remove these entries from the file manger table, it might speed up the page refresh.

 

any thoughts ?

Link to comment
Share on other sites

To speed up the page refresh when editing a product create a new folder in the images/source folder e.g. pictures then copy all of the files in the images/source folder into the new folder images/source/pictures (easy to do in cPanel) then run an sql query on the filemanager table to update the filepath to pictures/

UPDATE `CubeCart_filemanager` SET `filepath` = "pictures/";

Once all done delete the image files from the images/source folder.

 

 

Link to comment
Share on other sites

Well you can separate into several folders but that's going to be a pain. The above will remove the lag when doing general editing and the only time when there will be a lag problem is when changing images on a product because the pictures folder would have to be opened, however this is not done very often if at all once a product is listed.

Link to comment
Share on other sites

Sorted. definitely more responsive initially.

 

I assume that any new images will start to be uploaded to the source folder ?

However, if this is the case, then a similar update once every 12 months won't be hard work.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...